fix memory leak (#2549)
This commit is contained in:
parent
a273f55b6f
commit
87ebea7b0f
1 changed files with 3 additions and 3 deletions
|
@ -273,12 +273,12 @@ QModelIndex DeckListModel::findCard(const QString &cardName, const QString &zone
|
||||||
|
|
||||||
QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneName)
|
QModelIndex DeckListModel::addCard(const QString &cardName, const QString &zoneName)
|
||||||
{
|
{
|
||||||
InnerDecklistNode *zoneNode = createNodeIfNeeded(zoneName, root);
|
|
||||||
|
|
||||||
CardInfo *info = db->getCard(cardName);
|
CardInfo *info = db->getCard(cardName);
|
||||||
if(!info)
|
if (info == nullptr)
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
|
||||||
|
InnerDecklistNode *zoneNode = createNodeIfNeeded(zoneName, root);
|
||||||
|
|
||||||
QString cardType = info->getMainCardType();
|
QString cardType = info->getMainCardType();
|
||||||
InnerDecklistNode *cardTypeNode = createNodeIfNeeded(cardType, zoneNode);
|
InnerDecklistNode *cardTypeNode = createNodeIfNeeded(cardType, zoneNode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue