Skip to content

Commit

Permalink
FarGroupgh-783: Crash when opening a plugin via an association from a…
Browse files Browse the repository at this point in the history
… plugin panel
  • Loading branch information
alabuzhev committed Jan 27, 2024
1 parent fba6686 commit 31d27e3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 2024-01-27 16:45:12+00:00 - build 6261

1. gh-783: Crash when opening a plugin via an association from a plugin panel.

--------------------------------------------------------------------------------
drkns 2024-01-24 15:47:05+00:00 - build 6260

Expand Down
19 changes: 18 additions & 1 deletion far/filelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2716,7 +2716,24 @@ void FileList::ProcessEnter(bool EnableExec,bool SeparateWindow,bool EnableAssoc
bool OpenedPlugin = false;
const auto PluginMode = m_PanelMode == panel_mode::PLUGIN_PANEL && !PluginManager::UseInternalCommand(GetPluginHandle(), PLUGIN_FARGETFILE, m_CachedOpenPanelInfo);
string FileNameToDelete;
SCOPE_EXIT{ if (PluginMode && !OpenedPlugin && !FileNameToDelete.empty()) GetPluginHandle()->delayed_delete(FileNameToDelete); };

SCOPE_EXIT
{
if (PluginMode && !OpenedPlugin && !FileNameToDelete.empty())
{
if (const auto PluginHandle = GetPluginHandle())
{
PluginHandle->delayed_delete(FileNameToDelete);
}
else
{
// gh-783: in some cases the panel could be gone before we get here
delayed_deleter Deleter(true);
Deleter.add(FileNameToDelete);
}
}
};

file_state SavedState;

string strTempDir;
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6260
6261

0 comments on commit 31d27e3

Please sign in to comment.