зеркало из https://github.com/mono/mail-archives.git
112 строки
4.6 KiB
HTML
112 строки
4.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE> [Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions
|
|
</TITLE>
|
|
<LINK REL="Index" HREF="index.html" >
|
|
<LINK REL="made" HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20NullReferenceException%20issues%20-%20suggestion%20for%0A%09solutions&In-Reply-To=42A4A646.7090805%40gmail.com">
|
|
<META NAME="robots" CONTENT="index,nofollow">
|
|
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
|
<LINK REL="Previous" HREF="005957.html">
|
|
<LINK REL="Next" HREF="005959.html">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#ffffff">
|
|
<H1>[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions</H1>
|
|
<B>Thomas Harning Jr.</B>
|
|
<A HREF="mailto:gtk-sharp-list%40lists.ximian.com?Subject=%5BGtk-sharp-list%5D%20NullReferenceException%20issues%20-%20suggestion%20for%0A%09solutions&In-Reply-To=42A4A646.7090805%40gmail.com"
|
|
TITLE="[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions">harningt at gmail.com
|
|
</A><BR>
|
|
<I>Mon Jun 6 16:56:46 EDT 2005</I>
|
|
<P><UL>
|
|
<LI>Previous message: <A HREF="005957.html">[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions
|
|
</A></li>
|
|
<LI>Next message: <A HREF="005959.html">[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#5958">[ date ]</a>
|
|
<a href="thread.html#5958">[ thread ]</a>
|
|
<a href="subject.html#5958">[ subject ]</a>
|
|
<a href="author.html#5958">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
<HR>
|
|
<!--beginarticle-->
|
|
<PRE>Thomas Harning Jr. wrote:
|
|
><i> Thomas Harning Jr. wrote:
|
|
</I>><i> ...
|
|
</I>><i>
|
|
</I>>>><i>I've found that calling .Ref() on the Pixbuf will save it, andso
|
|
</I>>>><i>will adding that pixbuf to an arraylist to preserve a reference
|
|
</I>>>><i>to it.
|
|
</I>>>><i>* This is a HORRIBLE kludge and I'm not even sure if it fixes it
|
|
</I>>>><i>permanently (it stops the NRE in the short-run).
|
|
</I>><i>
|
|
</I>><i> ...
|
|
</I>><i>
|
|
</I>><i> I think I may have found the culprit... I had a thread that was
|
|
</I>><i> setting values in the Treestore that called upon the TreeView to
|
|
</I>><i> update through the ThreadNotify method... thinking that the
|
|
</I>><i> TreeStore wasn't 'quite' GUI-enough to need thread-protection. But
|
|
</I>><i> it seems that way.
|
|
</I>><i> I removed all reference preservation and the .Ref() from the Pixbuf
|
|
</I>><i> as well as columns and such... and there are no more crashes.
|
|
</I>><i> I'll keep my eye open for this occurring in the future, however.
|
|
</I>
|
|
|
|
Well the virtually untraceable error has come back.
|
|
I got GDB to trace it... and the highest point on the stack is
|
|
g_timeout_funcs in libglib-2.0.so.0
|
|
[there are 4 more stack elements above it, but they won't resolve w/
|
|
mono via mono_print_method_from_ip.]
|
|
|
|
I've tried to run mono --debug with GDB.... and the application
|
|
runs fine. Strangely.. without GDB, mono --debug almost instantly
|
|
crashes out w/ NRE.
|
|
|
|
The thing I added which seems to have retriggered the NRE problems
|
|
is using a single-column TreeStore and using callbacks to get the
|
|
value for the other columns by referencing the object inside the
|
|
TreeStore.
|
|
The callbacks are preserved in instance variables so they don't get
|
|
collected (which is apparently an issue in passing callbacks to GTK#).
|
|
|
|
--
|
|
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 : <A HREF="http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050606/01068c94/signature.bin">http://galactus.ximian.com/pipermail/gtk-sharp-list/attachments/20050606/01068c94/signature.bin</A>
|
|
</PRE>
|
|
|
|
|
|
<!--endarticle-->
|
|
<HR>
|
|
<P><UL>
|
|
<!--threads-->
|
|
<LI>Previous message: <A HREF="005957.html">[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions
|
|
</A></li>
|
|
<LI>Next message: <A HREF="005959.html">[Gtk-sharp-list] NullReferenceException issues - suggestion for
|
|
solutions
|
|
</A></li>
|
|
<LI> <B>Messages sorted by:</B>
|
|
<a href="date.html#5958">[ date ]</a>
|
|
<a href="thread.html#5958">[ thread ]</a>
|
|
<a href="subject.html#5958">[ subject ]</a>
|
|
<a href="author.html#5958">[ author ]</a>
|
|
</LI>
|
|
</UL>
|
|
|
|
<hr>
|
|
<a href="http://lists.ximian.com/mailman/listinfo/gtk-sharp-list">More information about the Gtk-sharp-list
|
|
mailing list</a><br>
|
|
</body></html>
|