Browse Source

Fixed problem with the model constructors: model was not saved in Mv, and thus garbage collected!

Yentl Van Tendeloo 9 years ago
parent
commit
8c670d2320

+ 10 - 2
bootstrap/modelling.alc

@@ -4,6 +4,8 @@ include "object_operations.alh"
 include "constructors.alh"
 include "metamodels.alh"
 
+Element global_models = ?
+
 String function instantiated_name(element : Element, original : String):
 	if (original == ""):
 		return "__" + cast_id2s(element)
@@ -369,7 +371,10 @@ Void function construct_model():
 	while (True):
 		command = input()
 		if (command == "instantiate_bottom"):
-			output(instantiate_bottom())
+			Element m
+			m = instantiate_bottom()
+			set_add(global_models, m)
+			output(m)
 		elif (command == "add_node"):
 			model_add_node(input(), input())
 		elif (command == "add_value"):
@@ -383,7 +388,10 @@ Void function construct_model():
 		elif (command == "retype"):
 			retype(input(), input(), input())
 		elif (command == "instantiate_model"):
-			output(instantiate_model(input()))
+			Element m
+			m = instantiate_model(input())
+			set_add(global_models, m)
+			output(m)
 		elif (command == "instantiate_node"):
 			instantiate_node(input(), input(), input())
 		elif (command == "instantiate_attribute"):

+ 1 - 1
hybrid_server/classes/mvkcontroller.xml

@@ -181,7 +181,7 @@
                         </raise>
                     </transition>
 
-                    <transition cond="self.timeout and self.destination is None" after="self.sccd_yield() + 0.05" target="."/>
+                    <transition cond="self.timeout and self.destination is None" after="self.sccd_yield() + 0.10" target="."/>
 
                     <transition cond="not self.timeout and self.destination is None" after="self.sccd_yield()" target="."/>
                 </state>

+ 1 - 0
kernel/modelverse_kernel/main.py

@@ -873,6 +873,7 @@ class ModelverseKernel(object):
                               ]
 
         if value is not None:
+            v =         yield [("RV", [value])]
             _, _, finish = \
                         yield [("CD", [user_frame, "returnvalue", value]),
                                ("CD", [user_root, "input", next]),