Skip to content

Commit

Permalink
Merge pull request #85 from lclc/otitemcleanup
Browse files Browse the repository at this point in the history
OTItem: replace OTCleanup with std::unique_ptr
  • Loading branch information
toxeus committed Aug 29, 2014
2 parents 24d756d + a588545 commit 4ccbad0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/OTItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
#include "stdafx.hpp"

#include "OTItem.hpp"
#include "OTCleanup.hpp"
#include "OTAccount.hpp"
#include "OTCheque.hpp"
#include "OTLedger.hpp"
Expand All @@ -143,6 +142,8 @@

#include <irrxml/irrXML.hpp>

#include <memory>

// Server-side.
//
// By the time this is called, I know that the item, AND this balance item
Expand Down Expand Up @@ -1283,10 +1284,9 @@ void OTItem::CalculateNumberOfOrigin()
// contains the number
// of origin as its transaction number.
//
OTItem* pOriginalItem = OTItem::CreateItemFromString(
strReference, GetPurportedServerID(), GetReferenceToNum());
std::unique_ptr<OTItem> pOriginalItem(OTItem::CreateItemFromString(
strReference, GetPurportedServerID(), GetReferenceToNum()));
OT_ASSERT(nullptr != pOriginalItem);
OTCleanup<OTItem> theItemAngel(pOriginalItem);

if (((m_Type == atDepositCheque) &&
(OTItem::depositCheque != pOriginalItem->GetType())) ||
Expand Down

0 comments on commit 4ccbad0

Please sign in to comment.