Re: GTK warning



Jeffrey Barish schrieb:
Stefan Kost wrote:

How should gobject know the name of your variable? In GStreamer we have a
GstObejct which has a name property, that makes it easier.

How do you know it's one of my variables that is being unreferenced?  The
warning message refers me to line 118 where I don't see that any of my
variables is being unreferenced.  If there's a problem in the
set_from_pixbuf call, I don't see why GTK can't provide more information
about the nature of the problem.  If there's a problem somewhere else, I
don't see why GTK is directing me to line 118.

its not gtk, its glib.
/myprogram.py:118: Warning: g_object_unref: assertion `object->ref_count >
0' failed

mean when you (or something you called) call(s) unref the refount is already 0.
That is somthing forgot to ref or something unref too much. glib can just point
out that something is wrong. Imho fixing refount problem is one of the most
difficult problems, very unfortunately.


I have now established that running the program with --g-fatal-warnings on
the command line does do something: It causes the program to exit, just as
it does in C.  However, in Python, I need to catch the exception before
exiting so that I can run the debugger and view the traceback, but it is
not possible to catch SystemExit.  I'm still clinging to the hope that a
traceback will be helpful despite your advice that it usually isn't when
the problem is a refcount issue.  Nevertheless, I clearly have fallen out
of the purview of this group, so I'll try to figure out a better place to
post.  Thanks anyway for all the suggestions.

What you need to do is to get traces for all refs and unref to that instance of
the object and find where they get unbalanced. refdbg.sf.net can help to get the
traces. One thing that is needed is to filter known paired ref/unrefs (like when
you do a g_onbject_set). Right now I go manualy over the traces and remove pairs
until I have tracked the issues down.

Stefan



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