Skip to content

Commit

Permalink
Fix crash when uninstalling the plugin (fix #1, Thanks LETARTARE )
Browse files Browse the repository at this point in the history
Fix the crash by deleting a pointer. Add also nullptr checks...
  • Loading branch information
bluehazzard committed May 17, 2020
1 parent 17ec2bd commit adf4cf5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cbBuildTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ void cbBuildTools::OnRelease(bool appShutDown)
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...

if(m_buildTargetsPanel != nullptr)
{
delete m_buildTargetsPanel;
m_buildTargetsPanel = nullptr;
}

}

void cbBuildTools::BuildMenu(wxMenuBar* menuBar)
Expand Down Expand Up @@ -126,11 +133,17 @@ void cbBuildTools::OnWindowMenu(wxCommandEvent& event)

void cbBuildTools::OnProjectActivatedEvent(CodeBlocksEvent& event)
{
if(m_buildTargetsPanel == nullptr)
return;

cbProject* pCBProject = event.GetProject();
m_buildTargetsPanel->ActivateProject(pCBProject);
}

void cbBuildTools::OnProjectCloseEvent(CodeBlocksEvent& event)
{
if(m_buildTargetsPanel == nullptr)
return;

m_buildTargetsPanel->ClearView();
}

0 comments on commit adf4cf5

Please sign in to comment.