Remove a module from DB

Hi

Probably stupid question: “How to remove a module from database?”
I tried multiple ways:

  • get the handler->reset the handler->commit the transaction but without success.
  • I took a look the entire sdk examples but without success, for sure I’m missing something.

Thanks

Hi,

see ITransaction::remove(). Note the part about “is still referenced”. For modules, there must be no references from other modules importing this one, from function calls created from definitions of this module, and from compiled materials referencing this module.

If you want to remove a larger group of modules (or DB elements in general) because, e.g., you are working on another “scene” or something like that, then your might want to use a child scope and remove the entire scope instead.

For now I fixed using IModule::reload and IModule::reload_from_string but I want to take a look to ITransaction::remove() because I have the feeling I didn’t get completly your design about transactions and scope. About pending references to the module around it was expected to me and indeed I thought “ok let’s remove all the materials and the compiled shaders to reset the module reference counter probably it will be discarded by the garbage collector” but it didn’t.
Thanks for the hint I will tke a look.