brndx Posted July 5, 2017 Share Posted July 5, 2017 The memory usage in my game appears to increase as the player progresses through more maps which leads me to believe that not everything is being released. This eventually results in a "not enough memory" error or vegetation / textures not loading. Are the sound sources released when world:clear() is called? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 5, 2017 Share Posted July 5, 2017 Sound sources are not entities and are not linked to any world. Therefore, clearing the world will not do anything to them. Sound-emitting entities will be cleared, however. 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...
brndx Posted July 6, 2017 Author Share Posted July 6, 2017 Do the variables holding the sound using Sound:Load need to be released or is it just the sound sources? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 6, 2017 Share Posted July 6, 2017 Sounds should be released when you are done with them: Sound* sound = Sound::Load("a.ogg"); Source* source = Source::Create(); source->SetSound(sound);//increments the reference count, so the sound does not get deleted yet sound->Release();//decrements the reference count, sound will be deleted when the source is released In Leadwerks 5 this will be automatic: auto sound = Sound::Load("a.ogg"); auto source = Source::Create(); source->SetSound(sound); 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...
brndx Posted July 6, 2017 Author Share Posted July 6, 2017 Ok. Is there anything other than the sounds / sound sources that aren't released by world:clear()? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 6, 2017 Share Posted July 6, 2017 Textures, materials, anything that isn't an entity. 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.