|
Re: Trouble with Published Game ... Again
[Re: Dooley]
#451925
05/26/15 15:11
05/26/15 15:11
|
Joined: Nov 2011
Posts: 274 de
lemming
Member
|
Member
Joined: Nov 2011
Posts: 274
de
|
From Gamestudio website: (...) memory and pointer handling, is automatically managed in lite-C. No crashes, memory leaks, and pointer arithmetics anymore! To stay on topic: I'm afraid there is no easy solution to find memory leaks in liteC. If you have problematic functions you don't understand, try to rewrite them from scratch to get a better understanding. This will improve your skills AND your code in most cases.
Last edited by lemming; 05/26/15 15:20.
|
|
|
Re: Trouble with Published Game ... Again
[Re: Dooley]
#451926
05/26/15 16:19
05/26/15 16:19
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Is this true? Maybe upgrading to A8 will solve my problem? No and no. A8 will not fix faulty code or even damaged files which can lead to crashes too, how would it. Memory leaks and other related crashes can be caused from of course not freeing allocated memory (i.e. you have to use sys_malloc or malloc in your code for that to happen) or overwriting stuff, for example for(i = 0; i <= 10; i++) my_array[i] = i; where var my_array[10]; does not have a 10th entry. As a result you overwrite the 4 byte that follows the my_array array in your memory and all kind of weird stuff can and usually will happen. The problem may lie somewhere completely else though too and that is a faulty file which happens more often than one would imagine. Over the years I've experienced that a few times already, and oftentimes I have to strip down my projects completely (make a backup first/ work with a backup copy) which can take a week or two. Preferably, you want to be able to delete as much as possible with the bug still intact so you can try and find its cause. Otherwise, if you only delete or change (as in your case) a little and the bug disappears it's likely you just have postponed the error to reappear at some random point in the future. I've once had random crashes in a multiplayer skateboarding game with multiple levels, I've checked everything, my whole code over and over, stripped down the whole project only to find (with the help of jcl) that one texture in one of the levels was damaged. Then on loading erroneous stuff would happen and overwrite random areas which would lead to subsequent code crashes.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
|