mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-04 17:40:01 +00:00
Convert MenuBaseData pointer to std::unique_ptr
This commit is contained in:
parent
1eace24891
commit
37d2b62250
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -186,7 +186,6 @@ MenuBox::MenuBox(WidgetType type)
|
||||
MenuBox::~MenuBox()
|
||||
{
|
||||
stopFilteringMouseDown();
|
||||
delete m_base;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -241,9 +240,8 @@ Menu* MenuBox::getMenu()
|
||||
|
||||
MenuBaseData* MenuBox::createBase()
|
||||
{
|
||||
delete m_base;
|
||||
m_base = new MenuBaseData;
|
||||
return m_base;
|
||||
m_base.reset(new MenuBaseData);
|
||||
return m_base.get();
|
||||
}
|
||||
|
||||
Menu* MenuItem::getSubmenu()
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2020 Igara Studio S.A.
|
||||
// Copyright (C) 2020-2021 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -67,7 +67,7 @@ namespace ui {
|
||||
void setMenu(Menu* menu);
|
||||
|
||||
MenuBaseData* getBase() {
|
||||
return m_base;
|
||||
return m_base.get();
|
||||
}
|
||||
|
||||
// Closes all menu-boxes and goes back to the normal state of the
|
||||
@ -85,7 +85,7 @@ namespace ui {
|
||||
void startFilteringMouseDown();
|
||||
void stopFilteringMouseDown();
|
||||
|
||||
MenuBaseData* m_base;
|
||||
std::unique_ptr<MenuBaseData> m_base;
|
||||
|
||||
friend class Menu;
|
||||
friend class MenuItem;
|
||||
|
Loading…
Reference in New Issue
Block a user