зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1322863 - part 1 - make ThreadInfo::mName a UniqueFreePtr; r=mstange
Smart pointers are better than raw pointers.
This commit is contained in:
Родитель
4d5ab006a2
Коммит
9a1517cd65
|
@ -35,7 +35,6 @@ ThreadInfo::ThreadInfo(const char* aName, int aThreadId,
|
|||
|
||||
ThreadInfo::~ThreadInfo() {
|
||||
MOZ_COUNT_DTOR(ThreadInfo);
|
||||
free(mName);
|
||||
|
||||
if (mProfile)
|
||||
delete mProfile;
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#ifndef MOZ_THREAD_INFO_H
|
||||
#define MOZ_THREAD_INFO_H
|
||||
|
||||
#include "mozilla/UniquePtrExtensions.h"
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
class ThreadInfo {
|
||||
|
@ -15,7 +17,7 @@ class ThreadInfo {
|
|||
|
||||
virtual ~ThreadInfo();
|
||||
|
||||
const char* Name() const { return mName; }
|
||||
const char* Name() const { return mName.get(); }
|
||||
int ThreadId() const { return mThreadId; }
|
||||
|
||||
bool IsMainThread() const { return mIsMainThread; }
|
||||
|
@ -41,7 +43,7 @@ class ThreadInfo {
|
|||
bool CanInvokeJS() const;
|
||||
|
||||
private:
|
||||
char* mName;
|
||||
mozilla::UniqueFreePtr<char> mName;
|
||||
int mThreadId;
|
||||
const bool mIsMainThread;
|
||||
PseudoStack* mPseudoStack;
|
||||
|
|
Загрузка…
Ссылка в новой задаче