paragui-users
[Top][All Lists]
Advanced

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

Re: [paragui-users] a little more info to help -> maybe not a dll proble


From: Alexander Pipelka
Subject: Re: [paragui-users] a little more info to help -> maybe not a dll problem
Date: 04 Jun 2002 19:50:19 +0200

Hehe,...

You are creating a static object (PG_Button) inside a function and
insert it into the list. The function returns the object gets deleted,
the list accesses the deleted button ,... bang.

Usually the compiler complains about this (at least GCC) with "taking
address of a temporary".

Create the button dynamically (new PG_Button) and everything should be
fine.

Alex


Am Die, 2002-06-04 um 19.34 schrieb Keith Swyer:
> well, i decided to try and test some classes without having them in a dll
> and i was able to reproduce the
> unhandled exception.  here is the class that i have.. (base class Area is
> still the same as before). As soon as
> the btn is attempted to be created i get the fault......any ideas??
> thanks again, keith
> 
> class lessonarea: public Area {
> public:
>     virtual void FillArea(void *data, void* data2);
>     virtual void ShowArea(void);
>     virtual void destroy(void)
>         {return;}
> };
> void lessonarea::FillArea(void *data, void* data2) {
> 
>     PG_Application *app = (PG_Application*)data;
> 
>     PG_Button btn(NULL, 3333, PG_Rect(50, 50, 50, 50), "shitters");
>     widgetlist.insert(widgetlist.end(), &btn);
> 
> 
> }
> void lessonarea::ShowArea(void){
>     list<PG_Widget*>::iterator itr;
> 
>     for (itr = widgetlist.begin(); itr != widgetlist.end(); itr++)
>         (*itr)->Show();
> }
> 
> 
> 
> 
> 
> _______________________________________________
> paragui-users mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users






reply via email to

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