Skip to content

Commit

Permalink
Merge pull request #558 from bdbcat/updates
Browse files Browse the repository at this point in the history
Correct Init()/Deinit() cycle behavior
  • Loading branch information
jongough authored Oct 19, 2024
2 parents c3a017c + 7bf79ae commit 4aa3d73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/ODicons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ void ODicons::initialize_images(void)

m_failedBitmapLoad = false;

// Reload scaling constants to pick up global changes
// and local config file
m_iToolScaleFactor = GetOCPNGUIToolScaleFactor_PlugIn();
m_iToolIconScaleFactor = g_IconDisplayScaleFactor * m_iToolScaleFactor;
m_iToolIconRefSize = g_IconDisplayScaleFactor * m_iToolScaleFactor;

#ifdef ODraw_USE_MUI
m_FileName.SetFullName(wxT("ODManager_MUI.svg"));
m_s_ocpn_draw_pi = m_FileName.GetFullPath();
Expand Down
7 changes: 2 additions & 5 deletions src/ocpn_draw_pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,13 +873,10 @@ bool ocpn_draw_pi::DeInit(void)

if( g_pODToolbar ) {
g_pODToolbar->Unbind(wxEVT_MENU, &ODToolbarImpl::OnToolButtonClick, g_pODToolbar);
delete m_pODicons;
m_pODicons = NULL;
delete g_pODToolbar;
g_pODToolbar = NULL;
}

delete m_pODicons;
m_pODicons = NULL;

if( g_ODEventHandler ) {
if(g_ODEventHandler->GetEvtHandlerEnabled())
g_ODEventHandler->SetEvtHandlerEnabled(false);
Expand Down

0 comments on commit 4aa3d73

Please sign in to comment.