Skip to content

Commit

Permalink
Reordered members for multithreading reasons.
Browse files Browse the repository at this point in the history
  • Loading branch information
5cript committed Nov 20, 2023
1 parent 88949b4 commit ede74ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nui/src/nui/backend/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,23 @@ namespace Nui
{
struct Window::Implementation : public std::enable_shared_from_this<Implementation>
{
std::recursive_mutex viewGuard;
boost::asio::thread_pool pool;
std::unique_ptr<webview::webview> view;
std::vector<std::filesystem::path> cleanupFiles;
std::unordered_map<std::string, std::function<void(nlohmann::json const&)>> callbacks;
boost::asio::thread_pool pool;
std::recursive_mutex viewGuard;
int width;
int height;
std::function<void(std::string_view)> onRpcError;

virtual void registerSchemeHandlers(WindowOptions const& options) = 0;

Implementation()
: view{}
: viewGuard{}
, pool{4}
, view{}
, cleanupFiles{}
, callbacks{}
, pool{4}
, viewGuard{}
, width{0}
, height{0}
, onRpcError{}
Expand Down Expand Up @@ -270,6 +270,7 @@ namespace Nui
//---------------------------------------------------------------------------------------------------------------------
Window::~Window()
{
impl_.reset();
for (auto const& file : impl_->cleanupFiles)
std::filesystem::remove(file);
}
Expand Down

0 comments on commit ede74ea

Please sign in to comment.