Added check for editor state during Edit menu display (ref #70).

This avoids a strange run-time error on Linux that appears to be caused
by UpdateUI checks in Edit menu for editor object that is out of use.
This commit is contained in:
Paul Kulchenko
2014-02-05 15:34:18 -08:00
parent f95a48212e
commit 7f00380fe1
2 changed files with 2 additions and 2 deletions

View File

@@ -458,7 +458,7 @@ function IndicateAll(editor, lines, linee)
-- this function can be called for an editor tab that is already closed
-- when there are still some pending events for it, so handle it.
if not pcall(function() return editor:GetId() end) then return end
if not pcall(function() editor:GetId() end) then return end
-- if markvars is not set in the spec, check for functions-only indicators
if not (editor.spec and editor.spec.markvars) then

View File

@@ -47,7 +47,7 @@ local function getControlWithFocus()
or ide.osname == 'Macintosh' and
ctrl:GetParent():GetId() == e:GetId()) then editor = e end
end
return editor
return pcall(function() editor:GetId() end) and editor or nil
end
local function onUpdateUIEditMenu(event)