Scott Richmond Posted November 3, 2011 Share Posted November 3, 2011 Hi, I need to be able to completely remove a model instance from a running LE game during runtime via C++. Any ideas? I've tried .free() and it seems to do nothing. I've tried deleting the pointer object, but I don't think Model has a comprehensive destructor setup. Help? Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
Roland Posted November 3, 2011 Share Posted November 3, 2011 Have you tested this? Model m; m.Load("abstract::mymodel.gmf"); ... ... ... m.Free() Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
TheoLogic Posted November 3, 2011 Share Posted November 3, 2011 If I'm not mistaken, LE is managed. So the garbage collector kan kick in whenever he wants... Just call Free when you don't need it anymore, when all references are gone and the garbage collector does his work the memory will be freed... Quote Follow me Link to comment Share on other sites More sharing options...
Andr3wHur5t Posted November 5, 2011 Share Posted November 5, 2011 Have you tried Free(m); where m is your model/entity? Quote Tools: AC3D | 3D Canvas(pro) | Texture Maker(pro) | Genetica(basic) | 3D World Studio | Fragmotion |Leadwerks 2 | XNA 4 | Visual Studio 2010 Professional | XCode 5.x |UU3D Pro Programing & Scripting Languages: C |C++ | C# | Obj-C | LUA | Javascript | PHP | Ruby Link to comment Share on other sites More sharing options...
Mumbles Posted November 5, 2011 Share Posted November 5, 2011 .free should do it... I have no problems at all using the procedural FreeEntity command. I believe though you have to call UpdateWorld (or whatever the OO version is) after freeing an entity before it actually will properly unload... Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Josh Posted November 5, 2011 Share Posted November 5, 2011 Hi, I need to be able to completely remove a model instance from a running LE game during runtime via C++. Any ideas? I've tried .free() and it seems to do nothing. I've tried deleting the pointer object, but I don't think Model has a comprehensive destructor setup. Help? What are you expecting it to do? Freeing an entity deletes it. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.