Fixing abort

This commit is contained in:
FlightControl 2017-05-05 12:05:46 +02:00
parent 1c4002fb37
commit 0b87b265c7
3 changed files with 13 additions and 12 deletions

View File

@ -1011,11 +1011,11 @@ do -- FSM_PROCESS
-- Copy Processes -- Copy Processes
for ProcessID, Process in pairs( self:GetProcesses() ) do for ProcessID, Process in pairs( self:GetProcesses() ) do
self:E( { Process} ) self:E( { Process} )
if Process.fsm then
Process.fsm:Remove() Process.fsm:Remove()
Process.fsm = nil Process.fsm = nil
end end
end
self._Processes = nil
return self return self
end end

View File

@ -882,7 +882,7 @@ do
local Path = ( ParentMenu and ( table.concat( ParentMenu.MenuPath or {}, "@" ) .. "@" .. MenuText ) ) or MenuText local Path = ( ParentMenu and ( table.concat( ParentMenu.MenuPath or {}, "@" ) .. "@" .. MenuText ) ) or MenuText
if MenuGroup._Menus[Path] then if MenuGroup._Menus[Path] then
self = MenuGroup._Menus[Path] self = MenuGroup._Menus[Path]
self:T( { "Re-using Group Command Menu:", MenuGroup:GetName(), MenuText } ) self:F2( { "Re-using Group Command Menu:", MenuGroup:GetName(), MenuText } )
else else
self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, ParentMenu, CommandMenuFunction, arg ) ) self = BASE:Inherit( self, MENU_COMMAND_BASE:New( MenuText, ParentMenu, CommandMenuFunction, arg ) )
@ -896,7 +896,7 @@ do
self.MenuText = MenuText self.MenuText = MenuText
self.ParentMenu = ParentMenu self.ParentMenu = ParentMenu
self:T( { "Adding Group Command Menu:", MenuGroup = MenuGroup:GetName(), MenuText = MenuText, MenuPath = self.MenuParentPath } ) self:F( { "Adding Group Command Menu:", MenuGroup = MenuGroup:GetName(), MenuText = MenuText, MenuPath = self.MenuParentPath } )
self.MenuPath = missionCommands.addCommandForGroup( self.MenuGroupID, MenuText, self.MenuParentPath, self.MenuCallHandler, arg ) self.MenuPath = missionCommands.addCommandForGroup( self.MenuGroupID, MenuText, self.MenuParentPath, self.MenuCallHandler, arg )
if self.ParentMenu and self.ParentMenu.Menus then if self.ParentMenu and self.ParentMenu.Menus then

View File

@ -882,13 +882,14 @@ end
function TASK:RemoveStateMachine( TaskUnit ) function TASK:RemoveStateMachine( TaskUnit )
self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } ) self:F( { TaskUnit, self.Fsm[TaskUnit] ~= nil } )
self:E( self.Fsm ) --self:E( self.Fsm )
for TaskUnitT, Fsm in pairs( self.Fsm ) do --for TaskUnitT, Fsm in pairs( self.Fsm ) do
local Fsm = Fsm -- Core.Fsm#FSM_PROCESS --local Fsm = Fsm -- Core.Fsm#FSM_PROCESS
self:E( TaskUnitT ) --self:E( TaskUnitT )
Fsm:Remove() --self.Fsm[TaskUnit] = nil
end --end
self.Fsm[TaskUnit]:Remove()
self.Fsm[TaskUnit] = nil self.Fsm[TaskUnit] = nil
collectgarbage() collectgarbage()