[glom] Frame_Glom: Use std::unique_ptr<> for dialogs instead of naked new.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Frame_Glom: Use std::unique_ptr<> for dialogs instead of naked new.
- Date: Fri, 5 Feb 2016 11:20:48 +0000 (UTC)
commit 4d71a48a300a74c66fb124751e8a6b81ad53d250
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Feb 5 11:09:40 2016 +0100
Frame_Glom: Use std::unique_ptr<> for dialogs instead of naked new.
glom/frame_glom.cc | 5 ++---
glom/frame_glom.h | 4 ++--
2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index 3cc1b8f..00b253e 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -87,7 +87,6 @@ Frame_Glom::Frame_Glom(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
m_pDialog_Reports(nullptr),
m_pDialogLayoutReport(nullptr),
m_pBox_Reports(nullptr),
- m_pDialog_PrintLayouts(nullptr),
m_pDialogLayoutPrint(nullptr),
m_pBox_PrintLayouts(nullptr),
m_pDialog_Fields(nullptr),
@@ -1702,7 +1701,7 @@ void Frame_Glom::on_menu_developer_reports()
return;
}
- m_pDialog_Reports = new Window_BoxHolder(m_pBox_Reports);
+ m_pDialog_Reports = std::make_unique<Window_BoxHolder>(m_pBox_Reports);
m_pDialog_Reports->set_transient_for(*(get_app_window()));
m_pDialog_Reports->set_title(_("Reports"));
@@ -1745,7 +1744,7 @@ void Frame_Glom::on_menu_developer_print_layouts()
return;
}
- m_pDialog_PrintLayouts = new Window_BoxHolder(m_pBox_PrintLayouts);
+ m_pDialog_PrintLayouts = std::make_unique<Window_BoxHolder>(m_pBox_PrintLayouts);
m_pDialog_PrintLayouts->set_transient_for(*get_app_window());
m_pDialog_PrintLayouts->set_title(_("Print Layouts"));
diff --git a/glom/frame_glom.h b/glom/frame_glom.h
index 3a44eef..dccd5c3 100644
--- a/glom/frame_glom.h
+++ b/glom/frame_glom.h
@@ -282,11 +282,11 @@ private:
#ifndef GLOM_ENABLE_CLIENT_ONLY
//Developer:
- Window_BoxHolder* m_pDialog_Reports;
+ std::unique_ptr<Window_BoxHolder> m_pDialog_Reports;
Dialog_Layout_Report* m_pDialogLayoutReport;
Box_Reports* m_pBox_Reports;
- Window_BoxHolder* m_pDialog_PrintLayouts;
+ std::unique_ptr<Window_BoxHolder> m_pDialog_PrintLayouts;
Window_PrintLayout_Edit* m_pDialogLayoutPrint;
Box_Print_Layouts* m_pBox_PrintLayouts;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]