paragui-users
[Top][All Lists]
Advanced

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

Re: [paragui-users] Help with menus...


From: atani
Subject: Re: [paragui-users] Help with menus...
Date: Mon, 24 Jun 2002 08:46:04 -0700

I think that is essentially what Alex is wanting there.  There are 
already hooks in the ctor to prevent multiple instances of the 
class...  However, the GetApp() method doesnt do the remainder of 
the "singleton" approach... 

If the conversion to "singleton" is to happen, I would suggest a new 
method to be added "PG_Application *getInstance()"

Mike

> We could use some variation on a singleton to hold the
> application object.
> 
> Andrew.
> 
> --- Atani <address@hidden> wrote:
> > On Monday 24 June 2002 07:47, Alexander Pipelka
> > wrote:
> > > Yes. It definitely depends on "when" the app
> > object will be destroyed.
> > > If it's in the main loop everythings ok because
> > the destructor of
> > > PG_Application is able to cleanup all objects.
> > >
> > > BTW, there's a new static function
> > PG_Application::GetApp()
> > 
> > Speaking of which, in the GetApp() method, there
> > should be a check to ensure 
> > that pGlobalApp is non-NULL.  When it is NULL, go
> > ahead and initialize it.
> > 
> > Mike
> > 
> > >
> > > :)
> > >
> > > Alex
> > >
> > > Am Mon, 2002-06-24 um 16.09 schrieb Atani:
> > > > Interestingly enough, if i declare it (globally)
> > as:
> > > >
> > > > PG_Application *app;
> > > >
> > > > and then in main do: app = new PG_Application();
> > it doesnt fail out
> > > > either. So something is perhaps dependent on
> > when it executes... do you
> > > > use atexit to trigger cleanups?
> > > >
> > > > Mike
> > > >
> > > > On Sunday 23 June 2002 13:18, Alexander Pipelka
> > wrote:
> > > > > Hi Mike!
> > > > >
> > > > > That's a really weird one .. :))
> > > > >
> > > > > Ok. Creating the PG_Application object inside
> > main() solves the
> > > > > problem. I haven't fully debugged it till now
> > but it seems there is
> > > > > some confusion in the shutdown/cleanup code.
> > > > >
> > > > > Alex
> > > > >
> > > > > Am Son, 2002-06-23 um 19.41 schrieb Atani:
> > > > > > On Sunday 23 June 2002 10:31, Eric Ross
> > wrote:
> > > > > > > Mensaje citado por Atani
> > <address@hidden>:
> > > > > > > > Hi all,
> > > > > > > >         Using the attached code I generate a
> > SIGSEGV everytime i close
> > > > > > > > the app..
> > > > > > >
> > > > > > > Can you attach some _working_ code ? I
> > mean something we could
> > > > > > > compile, execute and test ?
> > > > > >
> > > > > > Actually, the only thing that is missing
> > from that zip (globals.h,
> > > > > > includes headers, etc... and the main
> > method..)
> > > > > >
> > > > > > I have attached the full source for the
> > client app... its actually a
> > > > > > very basic app thus far that I am doing...
> > The final project will be
> > > > > > an online RPG of sorts :)
> > > > > >
> > > > > > Note, to compile SDL_net is required...
> > > > > >
> > > > > > > I've got what you're describing (SEGV when
> > closing the app)
> > > > > > > sometimes when there's memory
> > corruption(buffer overrun and so).
> > > > > > > Maybe you could try linking with some
> > memory tracer or
> > > > > > > something(libefence?) to check it's really
> > a bug ?
> > > > > >
> > > > > > Thats the really strange part... I believe
> > that I have done something
> > > > > > very basic as to expose the bug it just
> > requires running the app and
> > > > > > then close the app... do nothing in the
> > app... From what I have found
> > > > > > so far, it appears that calling app->Quit()
> > still allows some events
> > > > > > to be processed and when they are processed
> > some parts of PG are
> > > > > > already cleaned up and so the SIGSEGVs are
> > appropriate as an NPE type
> > > > > > case.
> > > > > >
> > > > > > Mike
> > > > >
> > > > >
> > _______________________________________________
> > > > > paragui-users mailing list
> > > > > address@hidden
> > > > >
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> > > >
> > > > _______________________________________________
> > > > paragui-users mailing list
> > > > address@hidden
> > > >
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> > >
> > > _______________________________________________
> > > paragui-users mailing list
> > > address@hidden
> > >
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> > 
> > 
> > _______________________________________________
> > paragui-users mailing list
> > address@hidden
> >
> http://mail.freesoftware.fsf.org/mailman/listinfo/paragui-users
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> _______________________________________________
> 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]