[Kde-bindings] KDE/kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Oct 6 15:34:05 UTC 2006


SVN commit 593030 by rdale:

* Added the QtDBus pingpong example

* Fixed a bug in slot return values where they were only
  working when a signal was emitted in Ruby, and not when
  a C++ signal was emitted. The zeroth element in the array
  of 'void*'s passed to qt_metacall() was being overwritten
  by a pointer to the result of the slot invocation. Instead
  the pointer in the zeroth element is now correctly deref'd,
  and the result put where it points to.

CCMAIL: kde-bindings at kde.org



 M  +12 -0     ChangeLog  
 M  +9 -2      rubylib/qtruby/marshall_types.cpp  


--- trunk/KDE/kdebindings/qtruby/ChangeLog #593029:593030
@@ -1,3 +1,15 @@
+2006-10-056  Richard Dale  <rdale at foton.es>
+
+	* Added the QtDBus pingpong example
+
+	* Fixed a bug in slot return values where they were only
+	  working when a signal was emitted in Ruby, and not when
+	  a C++ signal was emitted. The zeroth element in the array
+	  of 'void*'s passed to qt_metacall() was being overwritten
+	  by a pointer to the result of the slot invocation. Instead
+	  the pointer in the zeroth element is now correctly deref'd,
+	  and the result put where it points to.
+
 2006-10-05  Richard Dale  <rdale at foton.es>
 
 	* Each rbuic generated class is now wrapped in a Ui module so that as 
--- trunk/KDE/kdebindings/qtruby/rubylib/qtruby/marshall_types.cpp #593029:593030
@@ -537,7 +537,15 @@
 		_stack = new Smoke::StackItem[1];
 		Marshall::HandlerFn fn = getMarshallFn(type());
 		(*fn)(this);
+		// Save any address in zeroth element of the arrary of 'void*'s passed to 
+		// qt_metacall()
+		void * ptr = o[0];
 		smokeStackToQtStack(_stack, o, 1, _replyType);
+		// Only if the zeroth element of the arrary of 'void*'s passed to qt_metacall()
+		// contains an address, is the return value of the slot needed.
+		if (ptr != 0) {
+			*(void**)ptr = *(void**)(o[0]);
+		}
     }
 
     SmokeType type() { 
@@ -560,8 +568,7 @@
 	bool cleanup() { return false; }
 	
 	~SlotReturnValue() {
-		// Memory leak for now..
-//		delete[] _stack;
+		delete[] _stack;
 	}
 };
 



More information about the Kde-bindings mailing list