Advertisement Jump to content
Sign in to follow this  
Robert_M

Deleting modules

This topic is 4964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is there a way to delete module when needed? My problem is that when I discard a module it isn't deleted since it has non zero context reference count. In my app, I have a pool of contexts from which I take unused one and execute function with it, at the moment I load 2 scripts, the second one is loaded during execution of the first one, so they have different contexts assigned to them. When I try to delete modules (engine->Discard), they're not deleted at all, even though none of them is executing.

Share this post


Link to post
Share on other sites
Advertisement
They are not deleted since the contexts still hold references to them (as you accurately noted). The contexts free their references to the module when they themselves are released, or if they are prepared with another function.

The call to engine->Discard() only sets a flag for the module that says that it is not to be used anymore for new calls. You will not be able to prepare a context with a function from a discarded module. The module name is also freed so that you can compile another module reusing the name.

Regards,
Andreas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!