Re: Making a singleton of NautilusApplication



On Tue, 2005-08-02 at 22:49 +0200, Jaap Haitsma wrote:
> Hi,
> 
> As explained in my previous mail: "[PATCH] Jump To button in bookmark 
> dialog always open browers window" that patch also solves some critical 
> messages which were caused by the fact that nautilus_application_new is 
> called again.
> 
> Correct me if I'm wrong but I guess that per process there should be 
> only one instance of a NautilusApplication.
> 
> If so then I think it would be a good idea to make a singleton [1] of 
> NautilusApplication. This will guarantee that there is only one instance 
> of NautilusApplication and also access to the application object will be 
> very simple. You can just call nautilus_application_get_instance as soon 
> as you need the application object.
> 
> As far as I can see also of the NautilusShell there is only one object 
> needed.
> 
> Do the maintainers also think making a singleton of NautilusApplication 
> is a good idea?

It wouldn't hurt, but I don't think there is a problem with things
as-is. nautilus_application_new() is just called on startup, and its
pretty obvious that it shouldn't be called again. (Of course, that call
to it *did* leak into the code...)

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an impetuous vegetarian senator who dotes on his loving old ma. She's a 
warm-hearted antique-collecting Hell's Angel with the power to see death. They 
fight crime! 




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