4pane/0001-Fix-a-wx-assert-complaining-that-a-panel-was-being-a.patch
Luigi Baldoni 81ab9b5187 Accepting request 999180 from home:alois:branches:X11:Utilities
- Added 0001-Compilation-fixes-for-wxWidgets-3.1.6.patch,
  0001-Compilation-fix-for-wxWidgets-3.1.5.patch,
  0001-Fix-a-wx-assert-complaining-that-a-panel-was-being-a.patch,
  0001-Fix-a-wxAssert-when-showing-the-Command-line-termina.patch,
  and
  0001-Prevent-a-wx-build-warning-about-wxPATH_NORM_ALL-bei.patch
  to fix build with wxWidgets 3.2

OBS-URL: https://build.opensuse.org/request/show/999180
OBS-URL: https://build.opensuse.org/package/show/X11:Utilities/4pane?expand=0&rev=20
2022-08-25 07:21:42 +00:00

42 lines
1.4 KiB
Diff

From 20eb7c386d41fb2ee9fba4a3782403bcc476e236 Mon Sep 17 00:00:00 2001
From: dghart <dghart@users.sourceforge.net>
Date: Sun, 13 Feb 2022 10:58:47 +0000
Subject: [PATCH] Fix a wx assert complaining that a panel was being added to
the wrong sizer
The assert was technically correct, though it made no difference in practice.
However correcting it resulting in a double-free issue on deletion, fixed by not explicitly deleting the dirctrl's toolbar in the dtor.
---
MyDirs.cpp | 1 -
MyFrame.cpp | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/MyDirs.cpp b/MyDirs.cpp
index f370d5b..d4b8b81 100644
--- a/MyDirs.cpp
+++ b/MyDirs.cpp
@@ -435,7 +435,6 @@ enum
DirGenericDirCtrl::~DirGenericDirCtrl()
{
-if (toolBar != NULL) toolBar->Destroy();
}
void DirGenericDirCtrl::OnIdle(wxIdleEvent& WXUNUSED(event))
diff --git a/MyFrame.cpp b/MyFrame.cpp
index b3d8ebf..e59b003 100644
--- a/MyFrame.cpp
+++ b/MyFrame.cpp
@@ -2655,7 +2655,7 @@ DirSizer = new wxBoxSizer(wxVERTICAL);
FileSizer= new wxBoxSizer(wxVERTICAL);
DirToolbarSizer= new wxBoxSizer(wxVERTICAL);
-m_highlight_panel = new wxPanel(this);
+m_highlight_panel = new wxPanel(DirPanel);
m_highlight_panel->SetBackgroundColour(*wxGetApp().GetBackgroundColourUnSelected());
wxBoxSizer* highlight_panelSizer= new wxBoxSizer(wxVERTICAL);
m_highlight_panel->SetSizer(highlight_panelSizer);
--
2.37.2