[Kde-bindings] kdebindings/qtruby

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sun Oct 10 14:36:13 UTC 2004


CVS commit by rdale: 


* If a ruby method overriding a virtual method returned a primitive type when an instance of a class 
was expected, it caused a seg fault. A ruby exception is now thrown instead. Fixes problem reported by 
Han Holl. 

* For instance, 
            class ContainerGrid < Qt::Widget 
                def sizeHint 
                    # next line should return a Qt::Size, not an integer 
                    100 
                end 
             end 

Now gives the following error: 

       qsize.rb:12:in `method_missing': Invalid type, expecting QSize (ArgumentError) 
           from qsize.rb:12 

CCMAIL: kde-bindings at kde.org 


  M +21 -0     ChangeLog   1.124
  M +5 -0      rubylib/qtruby/handlers.cpp   1.70


--- kdebindings/qtruby/rubylib/qtruby/handlers.cpp  #1.69:1.70
@@ -613,4 +613,9 @@ marshall_basetype(Marshall *m)
           case Marshall::FromVALUE:
             {
+                if(TYPE(*(m->var())) != T_DATA) {
+            rb_raise(rb_eArgError, "Invalid type, expecting %s\n", m->type().name());
+                    break;
+                }
+                
                 smokeruby_object *o = value_obj_info(*(m->var()));
                 if(!o || !o->ptr) {

--- kdebindings/qtruby/ChangeLog  #1.123:1.124
@@ -1,4 +1,25 @@
 2004-10-10  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
 
+ * If a ruby method overriding a virtual method returned a primitive type when an instance of a class
+   was expected, it caused a seg fault. A ruby exception is now thrown instead. Fixes problem reported by
+   Han Holl.
+
+ * For instance,
+                    class ContainerGrid < Qt::Widget
+                        def sizeHint
+                            # next line should return a Qt::Size, not an integer
+                            100
+                        end
+                     end
+ 
+   Now gives the following error:
+
+               qsize.rb:12:in `method_missing': Invalid type, expecting QSize (ArgumentError)
+                   from qsize.rb:12
+
+ CCMAIL: kde-bindings at kde.org
+
+2004-10-10  Richard Dale  <Richard_Dale at tipitina.demon.co.uk>
+
  * The smokeruby_mark() function was only marking the immediate children of a
    Qt::Object for not being garbage collected. It now marks all the Qt::Objects





More information about the Kde-bindings mailing list