← Back to team overview

kicad-developers team mailing list archive

[PATCH] Fix incorrect (missing) initialisation of m_cur_grid in, symbols libraries table dialog box


Hi all,

There is an incorrect initialisation of variable m_cur_grid in
DIALOG_SYMBOL_LIB_TABLE (file eeschema/dialogs/dialog_sym_lib_table.cpp).

This result of a crash on eeschema when:
- opening "Symbol Library Table"
- click on "Ok" button

If before clicking on "Ok" you switch between "Global libraries" and
"Project Specific Librairies", the tab switch set correctly m_cur_grid
variable (with the handler pageChangedHandler) and the bug is no more

Please find attached the patch to fix this.

From 656814635fcf45480420c8bfc0ad3c09052b642f Mon Sep 17 00:00:00 2001
From: Jean-Samuel Reynaud <js.reynaud@xxxxxxxxx>
Date: Wed, 30 Aug 2017 19:36:03 +0200
Subject: [PATCH] Fix incorrect (missing) initialisation of m_cur_grid in
 symbols libraries table dialog box
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------2.7.4"

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit

 eeschema/dialogs/dialog_sym_lib_table.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

Content-Type: text/x-patch; name="0001-Fix-incorrect-missing-initialisation-of-m_cur_grid-i.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Fix-incorrect-missing-initialisation-of-m_cur_grid-i.patch"

diff --git a/eeschema/dialogs/dialog_sym_lib_table.cpp b/eeschema/dialogs/dialog_sym_lib_table.cpp
index ccaead2..cf091e5 100644
--- a/eeschema/dialogs/dialog_sym_lib_table.cpp
+++ b/eeschema/dialogs/dialog_sym_lib_table.cpp
@@ -202,9 +202,15 @@ DIALOG_SYMBOL_LIB_TABLE::DIALOG_SYMBOL_LIB_TABLE( wxTopLevelWindow* aParent,
     // for ALT+A handling, we want the initial focus to be on the first selected grid.
     if( m_pageNdx == 0 )
+    {
+        m_cur_grid = m_global_grid;
+    }
+    {
+        m_cur_grid = m_project_grid;
+    }
     // On some window managers (Unity, XFCE), this dialog is
     // not always raised, depending on this dialog is run.


Follow ups