Re: GTK warning



Dov Grobgeld wrote:
2009/2/21 Jeffrey Barish <jeff_barish earthlink net>

I hate the warning messages that GTK provides because they rarely help me
find the problem.  What does this one mean?

/myprogram.py:118: Warning: g_object_unref: assertion `object->ref_count
0' failed
 self['myimage'].set_from_pixbuf(mypb)

What object is producing the warning?  I suppose it must be myimage. 
What am I supposed to do?  If I exit the program and run it again, 9
times out of 10 I don't get the warning.

The message means exactly what it sais, that you try to reduce the ref
count of an object that doesn't exist.

Of course.  My complaint is that the message doesn't tell me which object. 
It refers me to a specific line in which it isn't obvious that any object
is being unreferenced.  That line sets the pixbuf, which, if anything,
would increase the ref count of something.  If the dereference occurs
somewhere else, then the warning shouldn't refer me to this line of code.

But since the example you give is in Python this probably means that there
is an error in the python binding. You should try to create a minimum
example that triggers the problem and try to create a bug report.

If there were an error in the Python binding, then I would expect the
warning to be consistent.  For that matter, it should be consistent if the
error were in my code or in GTK.

I'm running my program with --g-fatal-warnings at the end of the command
line.  I don't know whether that flag does anything in PyGTK, though.
-- 
Jeffrey Barish




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