Commit cee663cc authored by gsamain's avatar gsamain

Make reifying messages own a reference of hidden cyobjects

parent 28073d9c
...@@ -1242,6 +1242,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1242,6 +1242,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Acquire a ref on CyObject, as we don't know when the message will be processed # Acquire a ref on CyObject, as we don't know when the message will be processed
put_cypclass_op_on_narg_optarg(lambda _: "Cy_INCREF", reified_function_entry.type, Naming.optional_args_cname, code) put_cypclass_op_on_narg_optarg(lambda _: "Cy_INCREF", reified_function_entry.type, Naming.optional_args_cname, code)
code.putln("Cy_INCREF(this->%s);" % target_object_cname)
code.putln("}") code.putln("}")
code.putln("int activate() {") code.putln("int activate() {")
code.putln("/* Activate only if its sync object agrees to do so */") code.putln("/* Activate only if its sync object agrees to do so */")
......
...@@ -99,7 +99,11 @@ ...@@ -99,7 +99,11 @@
ActhonMessageInterface( ActhonMessageInterface(
ActhonSyncInterface* sync_method, ActhonSyncInterface* sync_method,
ActhonResultInterface* result_object ActhonResultInterface* result_object
) : _sync_method(sync_method), _result(result_object) {} ) : _sync_method(sync_method), _result(result_object)
{
Cy_INCREF(this->_sync_method);
Cy_INCREF(this->_result);
}
}; };
struct ActhonQueueInterface : CyObject { struct ActhonQueueInterface : CyObject {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment