[Gtk-sharp-list] Why does my AppIndicator disappear when I create it outside of my main method?

Matthew Pirocchi matthew.pirocchi at gmail.com
Wed Aug 4 19:45:45 EDT 2010


Ah, this was the problem. I needed to add two fields: One for the
AppIndicator in GmailAppIndicator, and one for the GmailAppIndicator in
MainClass. If I didn't add the second field, it still got garbage collected
just like Chris said. Thanks!

- Matthew

On Wed, Aug 4, 2010 at 7:11 PM, Christopher David Howie
<me at chrishowie.com>wrote:

> On 08/04/2010 06:58 PM, Michael Hutchinson wrote:
> > The ApplicationIndicator object will be garbage-collected any time
> > after the GmailAppIndicator ctor ends. You should keep a reference,
> > e.g. on a field in GmailAppIndicator.
>
> Technically, could it not be garbage-collected in his first example too?
>  The GC is free to collect objects contained in locals if those locals
> can never be accessed again.  (Or is the current GC engine not that smart?)
>
> --
> Chris Howie
> http://www.chrishowie.com
> http://en.wikipedia.org/wiki/User:Crazycomputers
>
> If you correspond with me on a regular basis, please read this document:
> http://www.chrishowie.com/email-preferences/
>
> PGP fingerprint: 2B7A B280 8B12 21CC 260A DF65 6FCE 505A CF83 38F5
>
> ------------------------------------------------------------------------
>                    IMPORTANT INFORMATION/DISCLAIMER
>
> This document should be read only by those persons to whom it is
> addressed.  If you have received this message it was obviously addressed
> to you and therefore you can read it.
>
> Additionally, by sending an email to ANY of my addresses or to ANY
> mailing lists to which I am subscribed, whether intentionally or
> accidentally, you are agreeing that I am "the intended recipient," and
> that I may do whatever I wish with the contents of any message received
> from you, unless a pre-existing agreement prohibits me from so doing.
>
> This overrides any disclaimer or statement of confidentiality that may
> be included on your message.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20100804/84cd2c95/attachment.html 


More information about the Gtk-sharp-list mailing list