Fixed #33 (Plugin factory not working when using with Python)

The fix consisted of introducing "factory" type virtual
methods which ensure that a reference is held to the
returned object. This is important for implementing
factory methods in Python. Without this, the object
get destroyed before we have a chance to increment the
reference count.
This commit is contained in:
Matthias Koefferlein
2017-12-11 23:51:00 +01:00
parent 11c9d37e93
commit 1cea7dfd23
6 changed files with 230 additions and 50 deletions
+1 -1
View File
@@ -509,7 +509,7 @@ Class<gsi::PluginFactoryBase> decl_PluginFactory ("PluginFactory",
"@args root\n"
"@param root The reference to the \\MainWindow object\n"
) +
callback ("create_plugin", &gsi::PluginFactoryBase::create_plugin_gsi, &gsi::PluginFactoryBase::f_create_plugin,
factory_callback ("create_plugin", &gsi::PluginFactoryBase::create_plugin_gsi, &gsi::PluginFactoryBase::f_create_plugin,
"@brief Creates the plugin\n"
"This is the basic functionality that the factory must provide. This method must create a plugin of the "
"specific type.\n"