From c3754d636902cecc55c6f5c6651ec99edca1ca7c Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Mon, 20 Nov 2017 23:24:03 +0100 Subject: [PATCH] smart pointer --- interface/src/Application.cpp | 4 ++-- libraries/entities/src/EntityTree.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0a25a98c43..d22ab8655d 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1186,8 +1186,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _entityEditSender.setMyAvatar(myAvatar.get()); // The entity octree will have to know about MyAvatar for the parentJointName import - getEntities()->getTree()->setMyAvatar(myAvatar.get()); - _entityClipboard->setMyAvatar(myAvatar.get()); + getEntities()->getTree()->setMyAvatar(myAvatar); + _entityClipboard->setMyAvatar(myAvatar); // For now we're going to set the PPS for outbound packets to be super high, this is // probably not the right long term solution. But for now, we're going to do this to diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h index 2dbe05e83b..d8981903d0 100644 --- a/libraries/entities/src/EntityTree.h +++ b/libraries/entities/src/EntityTree.h @@ -278,7 +278,7 @@ public: QByteArray computeEncryptedNonce(const QString& certID, const QString ownerKey); bool verifyDecryptedNonce(const QString& certID, const QString& decryptedNonce, EntityItemID& id); - void setMyAvatar(AvatarData* myAvatar) { _myAvatar = myAvatar; } + void setMyAvatar(std::shared_ptr myAvatar) { _myAvatar = myAvatar; } signals: void deletingEntity(const EntityItemID& entityID); @@ -386,7 +386,7 @@ private: void sendChallengeOwnershipRequestPacket(const QByteArray& certID, const QByteArray& encryptedText, const QByteArray& nodeToChallenge, const SharedNodePointer& senderNode); void validatePop(const QString& certID, const EntityItemID& entityItemID, const SharedNodePointer& senderNode, bool isRetryingValidation); - AvatarData* _myAvatar{ nullptr }; + std::shared_ptr _myAvatar{ nullptr }; }; #endif // hifi_EntityTree_h