From c80d92e927e4ed609ac3d992525c0d76f0a5787b Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 7 Dec 2015 10:24:31 +0100 Subject: [PATCH] Kicad manager: fix a potential bug which could crash Kicad manager. math_for_graphics.cpp: remove useless includes. --- kicad/class_treeproject_item.cpp | 3 ++- polygon/math_for_graphics.cpp | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kicad/class_treeproject_item.cpp b/kicad/class_treeproject_item.cpp index 1aa2d8eca3..8a6e135a8a 100644 --- a/kicad/class_treeproject_item.cpp +++ b/kicad/class_treeproject_item.cpp @@ -173,7 +173,8 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe ) wxString fullFileName = GetFileName(); wxTreeItemId id = GetId(); - KICAD_MANAGER_FRAME* frame = (KICAD_MANAGER_FRAME*) Pgm().App().GetTopWindow(); + KICAD_MANAGER_FRAME* frame = prjframe->m_Parent; + wxASSERT( frame ); switch( GetType() ) { diff --git a/polygon/math_for_graphics.cpp b/polygon/math_for_graphics.cpp index c43f3239ba..0dbf7a2cbd 100644 --- a/polygon/math_for_graphics.cpp +++ b/polygon/math_for_graphics.cpp @@ -6,9 +6,7 @@ #include #include #include -#include -#include #include static bool InRange( double x, double xi, double xf );