From d2d5657aff5eb085d9ff24c12e4b3e2dd1efd007 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 4 May 2018 15:10:44 +0200 Subject: [PATCH] DLIST: replace wxASSERT with wxCHECK for checks that would lead to a crash wxASSERT only shows a dialog saying that things went wrong (in debug mode), whereas wxCHECK will also terminate the function (also in release builds). --- common/dlist.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/dlist.cpp b/common/dlist.cpp index 512fd1ce7a..75cdadcf66 100644 --- a/common/dlist.cpp +++ b/common/dlist.cpp @@ -58,11 +58,11 @@ void DHEAD::DeleteAll() void DHEAD::append( EDA_ITEM* aNewElement ) { - wxASSERT( aNewElement != NULL ); + wxCHECK( aNewElement, /*void*/ ); if( first ) // list is not empty, first is not touched { - wxASSERT( last != NULL ); + wxCHECK( last, /*void*/ ); aNewElement->SetNext( 0 ); aNewElement->SetBack( last ); @@ -118,13 +118,13 @@ void DHEAD::append( DHEAD& aList ) void DHEAD::insert( EDA_ITEM* aNewElement, EDA_ITEM* aAfterMe ) { - wxASSERT( aNewElement != NULL ); + wxCHECK( aNewElement, /*void*/ ); if( !aAfterMe ) append( aNewElement ); else { - wxASSERT( aAfterMe->GetList() == this ); + wxCHECK( aAfterMe->GetList() == this, /*void*/ ); // the list cannot be empty if aAfterMe is supposedly on the list wxASSERT( first && last ); @@ -159,8 +159,7 @@ void DHEAD::insert( EDA_ITEM* aNewElement, EDA_ITEM* aAfterMe ) void DHEAD::remove( EDA_ITEM* aElement ) { - wxASSERT( aElement ); - wxASSERT( aElement->GetList() == this ); + wxCHECK( aElement && aElement->GetList() == this, /*void*/ ); if( aElement->Next() ) {