From bd783d4df1069dc145e76b0d093ba3726ef66bf7 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 19 Mar 2016 16:54:27 +0200 Subject: [PATCH] Check if next id is not bigger than UINT_MAX. --HG-- branch : develop --- src/libs/vpatterndb/vcontainer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libs/vpatterndb/vcontainer.cpp b/src/libs/vpatterndb/vcontainer.cpp index ec2dea58f..be2ed287c 100644 --- a/src/libs/vpatterndb/vcontainer.cpp +++ b/src/libs/vpatterndb/vcontainer.cpp @@ -197,6 +197,13 @@ quint32 VContainer::getId() */ quint32 VContainer::getNextId() { + //TODO. Current count of ids are very big and allow us save time before someone will reach its max value. + //Better way, of cource, is to seek free ids inside the set of values and reuse them. + //But for now better to keep it as it is now. + if (_id == UINT_MAX) + { + qCritical()<<(tr("Number of free id exhausted.")); + } _id++; return _id; }