Fix #8030 - fix multiple ref issue
authorAlan <alan@roojs.com>
Wed, 14 Feb 2024 05:02:14 +0000 (13:02 +0800)
committerAlan <alan@roojs.com>
Wed, 14 Feb 2024 05:02:14 +0000 (13:02 +0800)
src/Builder4/Editor.vala
src/JsRender/NodeToVala.vala

index 8422d9c..6d7d334 100644 (file)
@@ -65,13 +65,11 @@ public class Editor : Object
                this.el.vexpand = true;
                var child_1 = new Xcls_Box1( _this );
                child_1.ref();
-               child_1.ref();
                this.el.append( child_1.el );
                new Xcls_RightEditor( _this );
                this.el.append( _this.RightEditor.el );
                var child_3 = new Xcls_Box11( _this );
                child_3.ref();
-               child_3.ref();
                this.el.append ( child_3.el  );
        }
 
@@ -409,11 +407,9 @@ public class Editor : Object
                        this.el.append( _this.save_button.el );
                        var child_2 = new Xcls_Label3( _this );
                        child_2.ref();
-                       child_2.ref();
                        this.el.append( child_2.el );
                        var child_3 = new Xcls_Scale4( _this );
                        child_3.ref();
-                       child_3.ref();
                        this.el.append( child_3.el );
                        new Xcls_close_btn( _this );
                        this.el.append( _this.close_btn.el );
@@ -648,7 +644,6 @@ public class Editor : Object
                        this.el.buffer = _this.buffer.el;
                        var child_2 = new Xcls_EventControllerKey10( _this );
                        child_2.ref();
-                       child_2.ref();
                        this.el.add_controller(  child_2.el );
 
                        // init method
@@ -1179,7 +1174,6 @@ public class Editor : Object
                        this.el.append( _this.backBtn.el );
                        var child_5 = new Xcls_MenuButton17( _this );
                        child_5.ref();
-                       child_5.ref();
                        this.el.append( child_5.el );
                }
 
@@ -1210,7 +1204,6 @@ public class Editor : Object
                        this.el.search_delay = 3;
                        var child_1 = new Xcls_EventControllerKey13( _this );
                        child_1.ref();
-                       child_1.ref();
                        this.el.add_controller(  child_1.el );
 
                        //listeners
index bd74fe1..c80fd36 100644 (file)
@@ -392,19 +392,16 @@ public abstract class JsRender.NodeToVala : NodeWriter {
                        
                        // this is only needed if it does not have an ID???
                        var childname = this.addPropSet(child, child.has("id") ? child.get_prop("id").val : "") ; 
-                       if (!child.has("id")) {
-                               // must ref new objects..
-                               this.addLine("%s%s.ref();".printf(ipad, childname));
-                       }
+                       if (!child.has("id") && this.this_el == "this.el.") {
+                               this.addLine(this.ipad +  childname +".ref();"); 
+                       } 
                        if (child.has("* prop")) {
                         
                        
                                // fixme special packing!??!?!
                                if (child.get_prop("* prop").val.contains("[]")) {
-                                       // currently these 'child props
-                                       // used for label[]  on Notebook
-                                       // used for button[]  on Dialog?
-                                       // columns[] ?
+                                       // currently this is not used?
+                                       // and it will not add ref..
                                         
                                        this.packChild(child, childname, 0, 0, child.get_prop("* prop").val);  /// fixme - this is a bit speciall...
                                        continue;
@@ -420,9 +417,7 @@ public abstract class JsRender.NodeToVala : NodeWriter {
                                
                                continue;
                        } 
-                        if (!child.has("id") && this.this_el == "this.el.") {
-                               this.addLine(this.ipad +  childname +".ref();"); 
-                        } 
+                        
                        this.packChild(child, childname, cols, colpos);
                        
                        if (child.has("colspan")) {