Home > Back-end > Why the Delphi xe5 android dynamically created controls free not to drop
Why the Delphi xe5 android dynamically created controls free not to drop
Time:10-07
Such as: why Delphi xe5 android dynamically created controls free out The code is as follows:
For I:=0 to do pageCount - 1 The begin TbItem:=TTabItem. Create (nil); TbItem. Parent:=tb02; TbItem. Width:=tb02. Width; TbItem. Text:='first' + IntToStr (I + 1) + 'pages'; Tb02. ActiveTab:=tb02. Tabs [0]; end;//create
For I:=tb02. Downto TabCount - 1 0 do The begin Tb02. Tabs [I]. Free; end;//free
CodePudding user response:
After free, also exists in the interface
CodePudding user response:
Make up a missed lesson first, know the knowledge of Delphi Android development. Mobile version of the Free code is invalid. The object is to use reference counting survival from management. You can use the appropriate disposeOf forced to release, but also when forced to adopt.