forked from qt-creator/qt-creator
Utils: Change std::shared_ptr to std::unique_ptr
Its not necessary to use shared_ptr here, unique_ptr is enough. Change-Id: Ib30dce40054ae8f383674e2e70759e3c30710510 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -283,9 +283,9 @@ ElfReader::Result ElfReader::readIt()
|
||||
return Ok;
|
||||
}
|
||||
|
||||
std::shared_ptr<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
||||
std::unique_ptr<ElfMapper> ElfReader::readSection(const QByteArray &name)
|
||||
{
|
||||
std::shared_ptr<ElfMapper> mapper;
|
||||
std::unique_ptr<ElfMapper> mapper;
|
||||
readIt();
|
||||
int i = m_elfData.indexOf(name);
|
||||
if (i == -1)
|
||||
|
@@ -140,7 +140,7 @@ public:
|
||||
enum Result { Ok, NotElf, Corrupt };
|
||||
|
||||
ElfData readHeaders();
|
||||
std::shared_ptr<ElfMapper> readSection(const QByteArray §ionName);
|
||||
std::unique_ptr<ElfMapper> readSection(const QByteArray §ionName);
|
||||
QString errorString() const { return m_errorString; }
|
||||
QByteArray readCoreName(bool *isCore);
|
||||
|
||||
|
@@ -3130,7 +3130,7 @@ void CppDebuggerEngine::validateRunParameters(DebuggerRunParameters &rp)
|
||||
}
|
||||
if (globalRegExpSourceMap.isEmpty())
|
||||
return;
|
||||
if (std::shared_ptr<ElfMapper> mapper = reader.readSection(".debug_str")) {
|
||||
if (std::unique_ptr<ElfMapper> mapper = reader.readSection(".debug_str")) {
|
||||
const char *str = mapper->start;
|
||||
const char *limit = str + mapper->fdlen;
|
||||
bool found = false;
|
||||
|
Reference in New Issue
Block a user