Skip to content

Commit

Permalink
Construct wxFileSystemWatcher on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo committed Jan 8, 2025
1 parent b3bf8f2 commit 8b22c83
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct MyFrame : wxFrame {
wxTaskBarIcon tbi;
wxMenu *editmenupopup;
wxFileHistory filehistory;
unique_ptr<wxFileSystemWatcher> watcher {nullptr};
unique_ptr<wxFileSystemWatcher> watcher {make_unique<wxFileSystemWatcher>()};
wxAuiNotebook *nb {nullptr};
unique_ptr<wxAuiManager> aui {make_unique<wxAuiManager>(this)};
wxBitmap line_nw;
Expand Down Expand Up @@ -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));
}
Expand Down

0 comments on commit 8b22c83

Please sign in to comment.