mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-11 00:40:08 +00:00
Remove jwidget_free() function.
This commit is contained in:
parent
44856735be
commit
48f0a88d66
@ -309,13 +309,13 @@ int App::run()
|
|||||||
|
|
||||||
// Delete all editors first because they used signals from other
|
// Delete all editors first because they used signals from other
|
||||||
// widgets (e.g. color bar).
|
// widgets (e.g. color bar).
|
||||||
jwidget_free(box_editors);
|
delete box_editors;
|
||||||
|
|
||||||
// Destroy mini-editor.
|
// Destroy mini-editor.
|
||||||
exit_module_editors();
|
exit_module_editors();
|
||||||
|
|
||||||
// Destroy the top-window
|
// Destroy the top-window
|
||||||
jwidget_free(top_window);
|
delete top_window;
|
||||||
top_window = NULL;
|
top_window = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ static bool brush_type_change_hook(JWidget widget, void *data);
|
|||||||
static void on_exit_delete_this_widget()
|
static void on_exit_delete_this_widget()
|
||||||
{
|
{
|
||||||
ASSERT(window != NULL);
|
ASSERT(window != NULL);
|
||||||
jwidget_free(window);
|
delete window;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void on_pen_size_after_change()
|
static void on_pen_size_after_change()
|
||||||
@ -251,7 +251,7 @@ void ConfigureTools::onExecute(Context* context)
|
|||||||
"onionskin", &m_onionSkin, NULL);
|
"onionskin", &m_onionSkin, NULL);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
jwidget_free(window);
|
delete window;
|
||||||
window = NULL;
|
window = NULL;
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ private:
|
|||||||
JI_LIST_FOR_EACH_SAFE(m_stockListBox->children, link, next) {
|
JI_LIST_FOR_EACH_SAFE(m_stockListBox->children, link, next) {
|
||||||
Widget* listitem = reinterpret_cast<Widget*>(link->data);
|
Widget* listitem = reinterpret_cast<Widget*>(link->data);
|
||||||
m_stockListBox->removeChild(listitem);
|
m_stockListBox->removeChild(listitem);
|
||||||
jwidget_free(listitem);
|
delete listitem;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ConvolutionMatrixStock::iterator it = m_stock.begin(), end = m_stock.end();
|
for (ConvolutionMatrixStock::iterator it = m_stock.begin(), end = m_stock.end();
|
||||||
|
@ -112,7 +112,7 @@ FilterTargetButtons::FilterTargetButtons(int imgtype, bool withChannels)
|
|||||||
if (withChannels)
|
if (withChannels)
|
||||||
addChild(hbox);
|
addChild(hbox);
|
||||||
else
|
else
|
||||||
jwidget_free(hbox);
|
delete hbox;
|
||||||
|
|
||||||
ADD(this, index, onChannelChange);
|
ADD(this, index, onChannelChange);
|
||||||
ADD(this, images, onImagesChange);
|
ADD(this, images, onImagesChange);
|
||||||
|
@ -391,7 +391,7 @@ again:
|
|||||||
lastpath.c_str());
|
lastpath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
jwidget_free(window);
|
delete window;
|
||||||
window = NULL;
|
window = NULL;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -142,7 +142,7 @@ MenuItem::~MenuItem()
|
|||||||
jaccel_free(m_accel);
|
jaccel_free(m_accel);
|
||||||
|
|
||||||
if (m_submenu)
|
if (m_submenu)
|
||||||
jwidget_free(m_submenu);
|
delete m_submenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu* MenuBox::getMenu()
|
Menu* MenuBox::getMenu()
|
||||||
@ -264,7 +264,7 @@ void Menu::showPopup(int x, int y)
|
|||||||
menubox->setMenu(NULL);
|
menubox->setMenu(NULL);
|
||||||
|
|
||||||
// Destroy the window
|
// Destroy the window
|
||||||
jwidget_free(window);
|
delete window;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Menu::onProcessMessage(Message* msg)
|
bool Menu::onProcessMessage(Message* msg)
|
||||||
@ -828,7 +828,7 @@ bool MenuItem::onProcessMessage(Message* msg)
|
|||||||
window = (Frame*)menubox->parent;
|
window = (Frame*)menubox->parent;
|
||||||
ASSERT(window && window->type == JI_FRAME);
|
ASSERT(window && window->type == JI_FRAME);
|
||||||
|
|
||||||
// Fetch the "menu" to avoid free it with 'jwidget_free()'
|
// Fetch the "menu" to avoid destroy it with 'delete'.
|
||||||
menubox->setMenu(NULL);
|
menubox->setMenu(NULL);
|
||||||
|
|
||||||
// Destroy the window
|
// Destroy the window
|
||||||
@ -840,9 +840,9 @@ bool MenuItem::onProcessMessage(Message* msg)
|
|||||||
else
|
else
|
||||||
getManager()->setFocus(this->parent->parent);
|
getManager()->setFocus(this->parent->parent);
|
||||||
|
|
||||||
// Is not necessary to free this window because it's
|
// It is not necessary to delete this window because it's
|
||||||
// automatically destroyed by the manager
|
// automatically destroyed by the manager
|
||||||
// ... jwidget_free(window);
|
// ... delete window;
|
||||||
|
|
||||||
if (last_of_close_chain) {
|
if (last_of_close_chain) {
|
||||||
base->close_all = false;
|
base->close_all = false;
|
||||||
|
@ -32,7 +32,7 @@ PopupFrame::PopupFrame(const char* text, bool close_on_buttonpressed)
|
|||||||
// remove decorative widgets
|
// remove decorative widgets
|
||||||
JLink link, next;
|
JLink link, next;
|
||||||
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
||||||
jwidget_free(reinterpret_cast<JWidget>(link->data));
|
delete reinterpret_cast<Widget*>(link->data);
|
||||||
|
|
||||||
initTheme();
|
initTheme();
|
||||||
jwidget_noborders(this);
|
jwidget_noborders(this);
|
||||||
|
@ -183,7 +183,7 @@ TipWindow::TipWindow(const char *text, bool close_on_buttonpressed)
|
|||||||
|
|
||||||
// remove decorative widgets
|
// remove decorative widgets
|
||||||
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
||||||
jwidget_free(reinterpret_cast<JWidget>(link->data));
|
delete reinterpret_cast<Widget*>(link->data);
|
||||||
|
|
||||||
initTheme();
|
initTheme();
|
||||||
}
|
}
|
||||||
|
@ -85,12 +85,6 @@ Widget::Widget(int type)
|
|||||||
m_doubleBuffered = false;
|
m_doubleBuffered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void jwidget_free(JWidget widget)
|
|
||||||
{
|
|
||||||
ASSERT_VALID_WIDGET(widget);
|
|
||||||
delete widget;
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget::~Widget()
|
Widget::~Widget()
|
||||||
{
|
{
|
||||||
JLink link, next;
|
JLink link, next;
|
||||||
@ -115,7 +109,7 @@ Widget::~Widget()
|
|||||||
|
|
||||||
/* remove children */
|
/* remove children */
|
||||||
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
JI_LIST_FOR_EACH_SAFE(this->children, link, next)
|
||||||
jwidget_free(reinterpret_cast<JWidget>(link->data));
|
delete reinterpret_cast<Widget*>(link->data);
|
||||||
jlist_free(this->children);
|
jlist_free(this->children);
|
||||||
|
|
||||||
/* destroy the update region */
|
/* destroy the update region */
|
||||||
|
@ -38,8 +38,6 @@ typedef std::vector<Widget*> WidgetsList;
|
|||||||
|
|
||||||
int ji_register_widget_type();
|
int ji_register_widget_type();
|
||||||
|
|
||||||
void jwidget_free(JWidget widget);
|
|
||||||
|
|
||||||
/* hooks */
|
/* hooks */
|
||||||
|
|
||||||
void jwidget_add_hook(JWidget widget, int type,
|
void jwidget_add_hook(JWidget widget, int type,
|
||||||
|
@ -473,14 +473,14 @@ void close_editor(Editor* editor)
|
|||||||
|
|
||||||
// Remove this editor.
|
// Remove this editor.
|
||||||
parent_box->removeChild(view);
|
parent_box->removeChild(view);
|
||||||
jwidget_free(view);
|
delete view;
|
||||||
|
|
||||||
// Fixup the parent.
|
// Fixup the parent.
|
||||||
other_widget = reinterpret_cast<JWidget>(jlist_first_data(parent_box->children));
|
other_widget = reinterpret_cast<JWidget>(jlist_first_data(parent_box->children));
|
||||||
|
|
||||||
parent_box->removeChild(other_widget);
|
parent_box->removeChild(other_widget);
|
||||||
parent_box->getParent()->replaceChild(parent_box, other_widget);
|
parent_box->getParent()->replaceChild(parent_box, other_widget);
|
||||||
jwidget_free(parent_box);
|
delete parent_box;
|
||||||
|
|
||||||
// Find next editor to select.
|
// Find next editor to select.
|
||||||
if (!current_editor) {
|
if (!current_editor) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user