paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paragui-users] exception in widget array destruction


From: taurus
Subject: [paragui-users] exception in widget array destruction
Date: Thu, 13 Mar 2003 15:40:31 +0600

Hello,

I've got strange problem with following.

I've created a new class from PG_ThemeWidget to use it as a panel with
10 PG_Label. The idea is to add text to PG_Label widgets by timer,
some kind of karaoke.

I init PG_Label objects in the constructor like this:

        //In the class definition
        PG_Label *lines[NUMBEROFTIMINGLINES];

        //In the class constructor
        for (int i = 0; i < NUMBEROFTIMINGLINES; i++)
        {
                lines[i] = new PG_Label(this, PG_Rect(sX, sY, W, H), "");
                lines[i]->SetFontColor(120,30,40);
                lines[i]->SetFontStyle(PG_FSTYLE_BOLD);
                sY +=H; 
        }

I don't destroy lines[] objects in the class destructor, because, as I
noticed, ParaGUI will destroy them when class instance will be
destroyed.

The instance of my new class I create in the heap, not in the local
scope.

It works fine, the class does everything correct except destruction.
When class object is destroyed, application generates exception in
pgmessageobject.cpp in function PG_MessageObject::PumpIntoEventQueue()
on these lines:

=============================================
// send to all receivers
        bool processed = false;
        std::vector<PG_MessageObject*>::iterator list = objectList.begin();
        while(list != objectList.end()) {
                if((*list)->ProcessEvent(event)) {
                        processed = true;
                        break;          // exit loop if an object responds
                }
                list++;
        }
=============================================

It calls (*list) that was already destroyed.

If I comment out lines[] initialization and using, my class is
destroyed without any exception.

I suspect two things:
1) I do something wrong, then how can I create 10 lines of text in my
panel? It's better not to use widgetlist or richedit due to speed
issue.
2) There is a bug in ParaGUI...

Please, I need help as soon as possible, it stops all my work and I
already have spent almost 1 month with it...

Thank you!


Kind regards,
       taurus                          

address@hidden

 ->> "If you will have a megaphone, you will never have to be alone..."






reply via email to

[Prev in Thread] Current Thread [Next in Thread]