[Kde-bindings] KDE/kdebindings/csharp

Arno Rehn arno at arnorehn.de
Tue May 11 11:00:35 UTC 2010


On Tuesday 11 May 2010 12:52:33 Arno Rehn wrote:
> SVN commit 1125426 by arnorehn:
> 
> Fix some grave bugs in marshalling C++ stack variables to C# objects:
> 
> First, When calling a C# method from C++ (i.e. a virtual method or a slot),
> create copies of the stack arguments, which are then later used in C#.
> Before, if a signal linkClicked(QUrl) was connected to a slot, the wrapper
> C# class Qyoto.QUrl was created with the pointer to the temporary value
> QUrl. This lead to a double-free crash.
> 
> Second, if a C++ value is converted to a C# native type (e.g. QLists),
> always delete the original QList if it was passed on stack because it's
> not needed anymore.
> 
> Third, never ever delete pointers (even if cleanup() is set), when we later
> use them in C# (was the case with the char* and uchar* marshaller).
Code-wise QtRuby is the same, although I didn't experience any crashes because 
this, in contrast to C# where this lead to crashes rather frequently.
Does ruby do anything different? From a quick look over the code it seems 
pretty much the same.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list