[Kde-bindings] playground/bindings/kimono

Arno Rehn arno at arnorehn.de
Tue Feb 13 13:22:36 UTC 2007


Am Dienstag, 13. Februar 2007 schrieb Richard Dale:
> On Tuesday 13 February 2007, Richard Dale wrote:
> > * Removed the signal spy check and replaced it with a global flag
> >   'application_terminated'. Once the flag is set, destructors are no
> >   longer called.
>
> This doesn't work, and I don't really understand what is going on. I tried
> connecting to the signal 'aboutToQuit()' in the pong example like this:
>
> class Pong : QObject {
>     static private string SERVICE_NAME =
> "com.trolltech.QtDBus.PingExample";
>
>     [Q_SLOT]
>     public void Terminator() {
>         Console.WriteLine("Terminator called");
>         Qyoto.Qyoto.SetApplicationTerminated();
>     }
>
> ...
>
>         Pong pong = new Pong();
>         Connect(app, SIGNAL("aboutToQuit()"), pong, SLOT("Terminator()"));
>
> And it did emit the 'aboutToQuit()' signal even though
> QCoreApplication.Exec() wasn't called. But it still crashed:
>
> Terminator called
>
> ** ERROR **: EnterCriticalSection: EnterCriticalSection failed: Invalid
> argument
> aborting...
> ...
>
> I haven't tried a C++ class to catch the signal - I would like to
> understand what is going on really.
I only get a SIGSEGV error, but it is the same error I got before with my own 
code, if the qApp wasn't explicitely destroyed. This here is my workaround:

		// always delete the qApp, if requested. not doing so may cause errors.
		// if the qApp is destroyed, there's no need to call any more destructors,
		// that only leads to errors
		if (isDestructor() && qApp && (strcmp("QApplication",
			_smoke->className(_tmp.classId)) == 0
			|| strcmp("QCoreApplication", _smoke->className(_tmp.classId)) == 0))
			_called = false;

I don't know why this happens, too.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list