Skip to content

Commit

Permalink
un-nulled webview in onDestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
MeijisIrlnd committed Aug 15, 2024
1 parent f93f99c commit bed6c0a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/gui/mostlyharmless_WebviewEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace mostly_harmless::gui {
m_window->setMinimumSize(iWidth, iHeight);
m_window->setMinimumSize(iWidth, iHeight);
m_window->setWindowTitle("Test");
m_webview = std::make_unique<choc::ui::WebView>(choc::ui::WebView::Options{ .enableDebugMode=true} );
m_webview = std::make_unique<choc::ui::WebView>(choc::ui::WebView::Options{ .enableDebugMode = true });
m_window->setContent(m_webview->getViewHandle());
}

Expand Down Expand Up @@ -85,13 +85,12 @@ namespace mostly_harmless::gui {


void create() {
m_webview = std::make_unique<choc::ui::WebView>(choc::ui::WebView::Options{ .enableDebugMode=true} );
m_webview = std::make_unique<choc::ui::WebView>(choc::ui::WebView::Options{ .enableDebugMode = true });
helpers::macos::setViewSize(m_webview->getViewHandle(), m_initialWidth, m_initialHeight);
}

void destroy() {
helpers::macos::removeFromParentView(m_webview->getViewHandle());
m_webview = nullptr;
}

void getSize(std::uint32_t* width, std::uint32_t* height) {
Expand Down

0 comments on commit bed6c0a

Please sign in to comment.