From 5ffe161210aef98a51068234ead07b391ab0d34f Mon Sep 17 00:00:00 2001 From: Andy Huska Date: Fri, 23 Sep 2022 15:30:58 -0500 Subject: [PATCH] more clean up --- canframemodel.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/canframemodel.cpp b/canframemodel.cpp index 94f3ce0..df75171 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -684,20 +684,10 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false) if (!overwriteDups) { - bool alloc_ok = true; - try { frames.append(tempFrame); - } - catch (const std::exception& ex) - { - alloc_ok = false; - qDebug() << "addFrame failed to append. App is probably going to crash. frames.length(): " << frames.length() << " Exception: " << ex.what(); - } - if(alloc_ok) - { if (filters[tempFrame.frameId()] && busFilters[tempFrame.bus]) { if (autoRefresh) beginInsertRows(QModelIndex(), filteredFrames.count(), filteredFrames.count()); @@ -706,6 +696,10 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false) if (autoRefresh) endInsertRows(); } } + catch (const std::exception& ex) + { + qDebug() << "addFrame failed to append. App is probably going to crash. frames.length(): " << frames.length() << " Exception: " << ex.what(); + } } else //yes, overwrite dups {