← Back to team overview

kicad-developers team mailing list archive

[PATCH] Fix for stable (4.02) version: PCBNEW crashes on loading a file exported from Gerbview

 

Hi Wayne,

Attached a patch to fix lp:1598809 issue.
It is for stable branch, and built against rev 6290.

I committed this fix also in product branch.

Thanks.

-- 
Jean-Pierre CHARRAS
=== modified file 'pcbnew/files.cpp'
--- pcbnew/files.cpp	2016-05-27 18:36:53 +0000
+++ pcbnew/files.cpp	2016-07-05 15:10:40 +0000
@@ -571,8 +571,17 @@
     // Rebuild the new pad list (for drc and ratsnet control ...)
     GetBoard()->m_Status_Pcb = 0;
 
+    // Set current netclass in use NETCLASS::Default always exists
+    SetCurrentNetClass( NETCLASS::Default );
+
+    // Rebuild list of nets (full ratsnest rebuild)
+    {
+        wxBusyCursor dummy;    // Displays an Hourglass while building connectivity
+        Compile_Ratsnest( NULL, true );
+        GetBoard()->GetRatsnest()->ProcessBoard();
+    }
+
     // Update info shown by the horizontal toolbars
-    SetCurrentNetClass( NETCLASS::Default );
     ReFillLayerWidget();
     ReCreateLayerBox();
 
@@ -592,13 +601,6 @@
     // Display the loaded board:
     Zoom_Automatique( false );
 
-    // Compile ratsnest and displays net info
-    {
-        wxBusyCursor dummy;    // Displays an Hourglass while building connectivity
-        Compile_Ratsnest( NULL, true );
-        GetBoard()->GetRatsnest()->ProcessBoard();
-    }
-
     SetMsgPanel( GetBoard() );
 
     // Refresh the 3D view, if any


Follow ups