From 8b22c8334beace94721b035fcaed045dbb534c20 Mon Sep 17 00:00:00 2001 From: Tobias Predel Date: Wed, 8 Jan 2025 19:52:14 +0100 Subject: [PATCH] Construct wxFileSystemWatcher on startup --- src/myframe.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/myframe.h b/src/myframe.h index 548e65ca..fe8abd0c 100644 --- a/src/myframe.h +++ b/src/myframe.h @@ -5,7 +5,7 @@ struct MyFrame : wxFrame { wxTaskBarIcon tbi; wxMenu *editmenupopup; wxFileHistory filehistory; - unique_ptr watcher {nullptr}; + unique_ptr watcher {make_unique()}; wxAuiNotebook *nb {nullptr}; unique_ptr aui {make_unique(this)}; wxBitmap line_nw; @@ -731,8 +731,6 @@ struct MyFrame : wxFrame { } void AppOnEventLoopEnter() { - // Have to do this here, if we do it in the Frame constructor above, it crashes on OS X. - watcher.reset(new wxFileSystemWatcher()); watcher->SetOwner(this); Connect(wxEVT_FSWATCHER, wxFileSystemWatcherEventHandler(MyFrame::OnFileSystemEvent)); }