mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-15 20:42:40 +00:00
Fix crash closing the program when the Data Recovery tab open
This commit is contained in:
parent
a6041272c9
commit
0902fa7629
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -75,8 +76,7 @@ HomeView::~HomeView()
|
||||
{
|
||||
#ifdef ENABLE_DATA_RECOVERY
|
||||
if (m_dataRecoveryView) {
|
||||
if (m_dataRecoveryView->parent())
|
||||
App::instance()->workspace()->removeView(m_dataRecoveryView);
|
||||
ASSERT(!m_dataRecoveryView->parent());
|
||||
delete m_dataRecoveryView;
|
||||
}
|
||||
#endif
|
||||
@ -106,6 +106,14 @@ bool HomeView::onCloseView(Workspace* workspace, bool quitting)
|
||||
return true;
|
||||
}
|
||||
|
||||
void HomeView::onAfterRemoveView(Workspace* workspace)
|
||||
{
|
||||
if (m_dataRecoveryView &&
|
||||
m_dataRecoveryView->parent()) {
|
||||
workspace->removeView(m_dataRecoveryView);
|
||||
}
|
||||
}
|
||||
|
||||
void HomeView::onTabPopup(Workspace* workspace)
|
||||
{
|
||||
Menu* menu = AppMenus::instance()->getTabPopupMenu();
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -50,6 +51,7 @@ namespace app {
|
||||
// WorkspaceView implementation
|
||||
ui::Widget* getContentWidget() override { return this; }
|
||||
bool onCloseView(Workspace* workspace, bool quitting) override;
|
||||
void onAfterRemoveView(Workspace* workspace) override;
|
||||
void onTabPopup(Workspace* workspace) override;
|
||||
void onWorkspaceViewSelected() override;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2018 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -72,12 +72,15 @@ void Workspace::addView(WorkspaceView* view, int pos)
|
||||
|
||||
void Workspace::removeView(WorkspaceView* view)
|
||||
{
|
||||
ASSERT(view);
|
||||
base::remove_from_container(m_views, view);
|
||||
|
||||
WorkspacePanel* panel = getViewPanel(view);
|
||||
ASSERT(panel);
|
||||
if (panel)
|
||||
panel->removeView(view);
|
||||
|
||||
view->onAfterRemoveView(this);
|
||||
}
|
||||
|
||||
bool Workspace::closeView(WorkspaceView* view, bool quitting)
|
||||
|
@ -1,4 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
@ -38,6 +39,8 @@ namespace app {
|
||||
// the user cancels the operation.
|
||||
virtual bool onCloseView(Workspace* workspace, bool quitting) = 0;
|
||||
|
||||
virtual void onAfterRemoveView(Workspace* workspace) { }
|
||||
|
||||
virtual void onTabPopup(Workspace* workspace) = 0;
|
||||
|
||||
virtual InputChainElement* onGetInputChainElement() { return nullptr; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user