|
|
|
@ -226,7 +226,7 @@ void TQEventLoop::init()
|
|
|
|
|
printf("inside init(1)\n");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
g_main_loop_new (d->ctx, 1);
|
|
|
|
|
d->mainloop = g_main_loop_new (d->ctx, 1);
|
|
|
|
|
g_source_attach( (GSource*)qtGSource, d->ctx );
|
|
|
|
|
d->gSource = (GSource*)qtGSource;
|
|
|
|
|
|
|
|
|
@ -258,10 +258,22 @@ void TQEventLoop::cleanup()
|
|
|
|
|
// cleanup the X11 parts of the event loop
|
|
|
|
|
d->xfd = -1;
|
|
|
|
|
|
|
|
|
|
// stop polling the GSource
|
|
|
|
|
g_source_remove_poll(d->gSource, &d->threadPipe_gPollFD);
|
|
|
|
|
g_source_remove_poll(d->gSource, &d->x_gPollFD);
|
|
|
|
|
g_source_destroy(d->gSource);
|
|
|
|
|
|
|
|
|
|
// unref the main loop
|
|
|
|
|
g_main_loop_unref(d->mainloop);
|
|
|
|
|
d->mainloop = nullptr;
|
|
|
|
|
|
|
|
|
|
// unref the gsource
|
|
|
|
|
g_source_unref(d->gSource);
|
|
|
|
|
d->gSource = nullptr;
|
|
|
|
|
|
|
|
|
|
// unref the main context
|
|
|
|
|
g_main_context_unref(d->ctx);
|
|
|
|
|
|
|
|
|
|
// todo: destroy gsource
|
|
|
|
|
d->ctx = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TQEventLoop::processEvents( ProcessEventsFlags flags )
|
|
|
|
|