Freeing Memory?

BlitzMax Forums/BlitzMax Programming/Freeing Memory?

m_pTGamePlayScreen = New TGamePlayScreen

If of type TGamePlayScreen which is a type. Inside the Initialization of TGamePlayScreen a lot of different types are initialized:


Field m_pTTileMapLayer1:LayeredTileMap = Null
Field m_pTTileMapLayer2:LayeredTileMap = Null
Field m_pTTileMapLayer3:LayeredTileMap = Null

Field m_fLevelCompleteFadePercentage:Float
Field m_iState:Int

Field m_fLayer1Alpha:Float = .5
Field m_fLayer2Alpha:Float = 0.55 '.4
Field m_fLayer3Alpha:Float = 0.45 '.3

Field m_iBlend1:Int = 3
Field m_iBlend2:Int = 4
Field m_iBlend3:Int = 4

Field m_iDebug:Int = False

Field m_iLevel:Int = -1
Field m_pTStarship:TStarship = Null
Field m_pTPlayerList:TList = Null
Field m_pTGalaxy:TGalaxy = Null
Field m_pTPlayersAvatar:TStarship = Null
Field m_pTWeaponsMenu:TWeaponsMenu = Null



And they are initialized further in the lower objects. If setting a new'ed object to null doesn't work, how do you free it?

I can free all the lower objects first, but I would be setting them to null to free them?