libdgmpp
libdgmpp copied to clipboard
A way to create modules without adding to ship
Hello,
I was wondering if it was possible to add something to the Java-wrapper to create a module from a ship without adding it.
I am not a Cxx expert but this might work (I didn't try it, just typing)
- Add the following to Ship.hpp
Module* createModule(TypeID typeID) { LOCK(this); return Module::Create(typeID).get(); }
-
Add a corresponding method in Ship.i
-
Run swig/build.sh
Now when I say "this might work", I am wondering about the consequences of creating modules on the fly and not destroying the underlying Module pointer when done with it on the Java side.
I am not sure if JNI takes care of deleting references that are created by it and no longer used (GCed)