info about deleting objects
Posted on 2006-07-22
i have a near infinite loop (only exits on command).
what im noticing is the longer i run the program, the longer it takes to shut down. which to me leads me to believe i have a memory leak in my program. so ive placed the problem to one function. in this function i create a new instance of Rectangle, and a new instance of Vector3 everytime it is ran (which is approx once every 16.66 milliseconds).
now i was under the assumpsion that after the function executed, these values would be out of scope and therefore cleaned up by the garbage collector. but it seems not, becuase like i said, if its ran for a couple minutes the program seriously laggs.
i also should note, which i think is an important point, that i am not creating variables with the calls to new Rectange and new Vector3, i am passing them into a function.
i guess my question is now do i delete the references to these objects?