Took out unnecessary exception recover code

Cuz app is going to crash anyway, no need to make a mess
This commit is contained in:
Andy Huska
2022-09-23 15:28:41 -05:00
parent 53882805e7
commit f38e0b0bfa
+9 -12
View File
@@ -61,8 +61,9 @@ CANFrameModel::CANFrameModel(QObject *parent)
QSettings settings; QSettings settings;
int preallocSize = settings.value("Main/MaximumFrames", maxFramesDefault).toInt(); int preallocSize = settings.value("Main/MaximumFrames", maxFramesDefault).toInt();
//the goal is to prevent a reallocation from ever happening
frames.reserve(preallocSize); frames.reserve(preallocSize);
filteredFrames.reserve(preallocSize); //the goal is to prevent a reallocation from ever happening filteredFrames.reserve(preallocSize);
dbcHandler = DBCHandler::getReference(); dbcHandler = DBCHandler::getReference();
interpretFrames = false; interpretFrames = false;
@@ -685,18 +686,14 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false)
{ {
bool alloc_ok = true; bool alloc_ok = true;
for(int i=0; i<3; i++) try
{ {
try frames.append(tempFrame);
{ }
frames.append(tempFrame); catch (const std::exception& ex)
break; {
} alloc_ok = false;
catch (const std::exception& ex) qDebug() << "addFrame failed to append. App is probably going to crash. frames.length(): " << frames.length() << " Exception: " << ex.what();
{
alloc_ok = false;
qDebug() << "addFrame failed to append. frames.length(): " << frames.length() << " Exception: " << ex.what();
}
} }
if(alloc_ok) if(alloc_ok)