Paul Posted March 8, 2010 Share Posted March 8, 2010 Calling Framework::Free() on an existing Framework causes an access violation. The problem seems to be Layer::operator=() is treating 0 as a pointer. Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit Link to comment Share on other sites More sharing options...
Scott Richmond Posted March 12, 2010 Share Posted March 12, 2010 You might want to look at the way you're calling it. Framework is instantiated and therefore calling Framework::Free() is likely trying to free a non-existant instance of Framework. Try calling framework.free() instead (Or whatever you called your Framework instance). 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...
Paul Posted March 13, 2010 Author Share Posted March 13, 2010 How should I be calling it? This shows what I'm talking about. #include "leo.h" using namespace LEO ; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ) { Engine engine( "Game", 800, 600 ) ; Engine::SetAbstractPath( "E:/Program Files (x86)/Leadwerks Engine SDK" ) ; Engine::SetFilters() ; Engine::SetShadowQuality(DEEPSHADOW); World world( CREATENOW ) ; if( !world.IsValid() ) { MessageBoxA(0,"Error","Failed to create world.",MB_OK); return engine.Free() ; } Framework fw; fw.Create(); fw.Free(); // Done return engine.Free() ; } Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit Link to comment Share on other sites More sharing options...
Scott Richmond Posted March 13, 2010 Share Posted March 13, 2010 fw.Free() works does it not? 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...
Canardia Posted March 13, 2010 Share Posted March 13, 2010 Here's a quick fix: inline void Framework::Free() { if ( m_entity && g_engineLoaded && !mIsReference ) { ::leFreeFramework( m_entity ); m_entity = 0; renderer.Free(); background.Free(); main.Free(); transparency.Free(); listener.Free(); } } Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■ Link to comment Share on other sites More sharing options...
Paul Posted March 13, 2010 Author Share Posted March 13, 2010 fw.Free() works does it not? No, thats what I've just been saying. Quote Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit 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.