[Gtk-sharp-list] NullReferenceException issues - suggestion for solutions

Thomas Harning Jr. harningt at gmail.com
Mon Jun 6 15:38:46 EDT 2005

Thomas Harning Jr. wrote:
>> I've found that calling .Ref() on the Pixbuf will save it, andso
>> will adding that pixbuf to an arraylist to preserve a reference
>> to it.
>> * This is a HORRIBLE kludge and I'm not even sure if it fixes it
>> permanently (it stops the NRE in the short-run).

I think I may have found the culprit... I had a thread that was
setting values in the Treestore that called upon the TreeView to
update through the ThreadNotify method... thinking that the
TreeStore wasn't 'quite' GUI-enough to need thread-protection.  But
it seems that way.
I removed all reference preservation and the .Ref() from the Pixbuf
as well as columns and such... and there are no more crashes.
I'll keep my eye open for this occurring in the future, however.

Thomas Harning Jr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050606/948f00bc/signature.bin

More information about the Gtk-sharp-list mailing list