mail-archives/gtk-sharp-list/2005-June/005958.html

112 строки
4.6 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:02:55 +03:00
<!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:
&gt;<i> Thomas Harning Jr. wrote:
</I>&gt;<i> ...
</I>&gt;<i>
</I>&gt;&gt;&gt;<i>I've found that calling .Ref() on the Pixbuf will save it, andso
</I>&gt;&gt;&gt;<i>will adding that pixbuf to an arraylist to preserve a reference
</I>&gt;&gt;&gt;<i>to it.
</I>&gt;&gt;&gt;<i>* This is a HORRIBLE kludge and I'm not even sure if it fixes it
</I>&gt;&gt;&gt;<i>permanently (it stops the NRE in the short-run).
</I>&gt;<i>
</I>&gt;<i> ...
</I>&gt;<i>
</I>&gt;<i> I think I may have found the culprit... I had a thread that was
</I>&gt;<i> setting values in the Treestore that called upon the TreeView to
</I>&gt;<i> update through the ThreadNotify method... thinking that the
</I>&gt;<i> TreeStore wasn't 'quite' GUI-enough to need thread-protection. But
</I>&gt;<i> it seems that way.
</I>&gt;<i> I removed all reference preservation and the .Ref() from the Pixbuf
</I>&gt;<i> as well as columns and such... and there are no more crashes.
</I>&gt;<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>