Page 1 of 1

moai.FreeObject("menRecentSearches") doesn't frees its children (items)!?

Posted: Sun Apr 27, 2025 2:02 pm
by bitRocky
I do this:

Code: Select all

  moai.DoMethod("menu", "Remove", "menRecentSearches")
  moai.FreeObject("menRecentSearches") 
to remove a menu from the menubar, but it seems that FreeObject() doesn't automatically frees the items of the menu!?
Shouldn't it also remove all its children/items?

I have to do that to free also all of its item:

Code: Select all

	For Local i=1 To RecentSearchMax
		If moai.HaveObject("itmRS"..i)
			DebugPrint("have itmRS"..i)
			moai.DoMethod("menRecentSearches", "Remove", "itmRS"..i)
			moai.FreeObject("itmRS"..i)
		Else 
			DebugPrint("dont have itmRS"..i)
		EndIf 
	Next
	moai.FreeObject("menRecentSearches")

Re: moai.FreeObject("menRecentSearches") doesn't frees its children (items)!?

Posted: Sun May 04, 2025 5:22 pm
by airsoftsoftwair
That menu stuff is complicated, please provide a full MCVE :)