projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
It seems wrong to Destroy() these widgets as I think the parent will do it.
[dcpomatic.git]
/
src
/
wx
/
language_tag_widget.cc
diff --git
a/src/wx/language_tag_widget.cc
b/src/wx/language_tag_widget.cc
index f28046bd9be59628fe952734a6a7939f5fef8730..1a6f3fabc219dd799a137ed4873c154c9c7c91a0 100644
(file)
--- a/
src/wx/language_tag_widget.cc
+++ b/
src/wx/language_tag_widget.cc
@@
-22,6
+22,7
@@
#include "dcpomatic_button.h"
#include "language_tag_dialog.h"
#include "language_tag_widget.h"
#include "dcpomatic_button.h"
#include "language_tag_dialog.h"
#include "language_tag_widget.h"
+#include "wx_ptr.h"
#include "wx_util.h"
#include "lib/scope_guard.h"
#include <dcp/warnings.h>
#include "wx_util.h"
#include "lib/scope_guard.h"
#include <dcp/warnings.h>
@@
-56,18
+57,10
@@
LanguageTagWidget::LanguageTagWidget (wxWindow* parent, wxString tooltip, option
}
}
-LanguageTagWidget::~LanguageTagWidget ()
-{
- _language->Destroy ();
- _edit->Destroy ();
-}
-
-
void
LanguageTagWidget::edit ()
{
void
LanguageTagWidget::edit ()
{
- auto d = new LanguageTagDialog(_parent, _tag.get_value_or(dcp::LanguageTag("en")));
- ScopeGuard sg = [d]() { d->Destroy(); };
+ auto d = make_wx<LanguageTagDialog>(_parent, _tag.get_value_or(dcp::LanguageTag("en")));
if (d->ShowModal() == wxID_OK) {
set(d->get());
Changed(d->get());
if (d->ShowModal() == wxID_OK) {
set(d->get());
Changed(d->get());