Re: Glib::TimeoutSource and Glib::IOSource

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.

View this message in context:
Sent from the Gtkmm mailing list archive at

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