Commit d7092e57 authored by gsamain's avatar gsamain

Make ActhonActivableClass cleaner and safer (handles its own refcount)

parent 28e12660
...@@ -112,9 +112,16 @@ ...@@ -112,9 +112,16 @@
}; };
struct ActhonActivableClass : public CyObject { struct ActhonActivableClass : public CyObject {
ActhonResultInterface *(*_active_result_class)(void);
ActhonQueueInterface *_active_queue_class = NULL; ActhonQueueInterface *_active_queue_class = NULL;
virtual ~ActhonActivableClass() {} ActhonResultInterface *(*_active_result_class)(void);
ActhonActivableClass(){} // Used in Activated classes inheritance chain (base Activated calls this, derived calls the 2 args version below)
ActhonActivableClass(ActhonQueueInterface * queue_object, ActhonResultInterface *(*result_constructor)(void))
: _active_queue_class(queue_object), _active_result_class(result_constructor) {
Cy_INCREF(this->_active_queue_class);
}
virtual ~ActhonActivableClass() {
Cy_XDECREF(this->_active_queue_class);
}
}; };
static inline int _Cy_DECREF(CyObject *op) { static inline int _Cy_DECREF(CyObject *op) {
......
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