Re: Glib::TimeoutSource and Glib::IOSource

Which version of glibmm do you use?

When I tested with glibmm 2.37.4 and 2.38.1 (the versions I have easily available), the only output was:

Your CRITICAL message might be related to the bug, which has been fixed in glibmm 2.37.4 and later. (That bug report is still open. That's because the fix is ugly, and I hope someone can find a better one.)


2014-01-12 00:03, ricardo skrev:
Many thanks to this thread.  All the comments have been extremely helpful.
That's to say my code no longer crashes. However did anyone ever figure out
how to safely remove the IOSource object without receiving the following?

    GLib-CRITICAL **: g_source_unref: assertion `source != NULL' failed

I have a list of objects each with:
        Glib::RefPtr<Glib::IOSource>   io_source;  // I believe this is the
offending object

        io_source.clear();  // avoids "segmentation fault" when deleting
object but generates the "Glib-CRITICAL" error.

I believe the RefPtr to io_source is the cause of my error message as my
objects are distroyed. Anyone have any ideas how to prevent the error?  

My Code:
test-spawn.cpp <> <>  

Build command: 
g++ -Wall $(pkg-config gtkmm-3.0 gtk+-3.0 gmodule-2.0 --cflags) $(pkg-config
gtkmm-3.0 gtk+-3.0  gmodule-2.0 --libs gthread-2.0) -o "%e" "%f"
-std=gnu++11 -export-dynamic

type a unix command, then click [Clear] to erase any/all completed processes
from the procq.

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