Jump to content

world:Clear() - work around vs fix


Gonan
 Share

Recommended Posts

http://www.leadwerks.com/werkspace/topic/11458-maxcharacterstest/

 

Hi Josh,

 

I've been having a problem with my game crashing, after reloading a map, or sequence of maps.

 

After creating a couple of demos, of the problem, the community (Thanks nick.ace) has found a cool work around. See Link above.

 

This involves replacing in App.Lua

 

self.world:Clear()

 

with

 

self.world:Release()

self.world=World:Create()

 

and a creating a new world to load the next map into.

 

This work around means I am no longer restricted to 3 or 4 levels when writing my game.

 

Whilst the issue may be in my code, you may find that world:Clear() leaves something behind, or doesn't reset something.

 

I will use the work around until a permanent fix is found.

 

Thanks

  • Upvote 1
Link to comment
Share on other sites

Well, when any entity's physics mode is set to character controller, there is a mem leak. I believe this is the cause...

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

I had got to that point too, by not having any scripts attached, and then turning off the character controller, making it rigid physics, and found the crash no longer happened. But it was eliminating too much of the problem's characteristics to be useful to debug further.

 

It brought back memories of algebra from 40 years ago, when I would work out 0 == 0

Link to comment
Share on other sites

Okay, I fixed not one, not two, but THREE memory leaks. Not sure if I should be bragging about this, but I am running a full build now...

  • Upvote 3

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

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...