[Kde-bindings] Another patch for Qyoto

Arno Rehn arno at arnorehn.de
Thu Aug 24 13:44:08 UTC 2006


Am Donnerstag, 24. August 2006 12:21 schrieb Richard Dale:
> On Monday 21 August 2006 21:38, Arno Rehn wrote:
> > The solution was quite simple: We only need to delete() the C++ qApp when
> > quitting. Apparently this isn't done by mono. I think this would require
> > us to create a wrapper instance around our C++ qApp and set this as the
> > C# qApp. But I think my solution is by far simpler and at the moment OK.
> > If someone feels like doing it with a wrapper instance, please do it.
> > That is a for sure a cleaner way than mine.
>
> So do we need to add a call in the C# code to invoke DeleteQApp() on exit?
> I don't see how it works.

Yes, I implemented the call at the end of QApplication.Exec(). Here Is the 
code:

public static new int Exec() {
	int ret = StaticQApplication().Exec();
	Qyoto.DeleteQApp();
	return ret;
}

As soon as exec() has finished, the QApplication has quit its main loop and is 
about to be destroyed. So now we can delete the C++-qApp and return the 
return value.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list