mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-23 08:09:51 +00:00
Qt: don't return dangling pointer
This commit is contained in:
parent
d9b6ab83cf
commit
039fba0344
@ -18,12 +18,12 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "Qt/QtHost.h"
|
#include "Qt/QtHost.h"
|
||||||
|
|
||||||
const char* QtHost::SymbolMapFilename(std::string currentFilename) {
|
std::string QtHost::SymbolMapFilename(std::string currentFilename) {
|
||||||
std::string result = currentFilename;
|
size_t dot = currentFilename.rfind('.');
|
||||||
size_t dot = result.rfind('.');
|
if (dot == std::string::npos)
|
||||||
if (dot == result.npos)
|
currentFilename.append(".map");
|
||||||
return (result + ".map").c_str();
|
else
|
||||||
|
currentFilename.replace(dot, -1, ".map");
|
||||||
|
|
||||||
result.replace(dot, result.npos, ".map");
|
return currentFilename;
|
||||||
return result.c_str();
|
|
||||||
}
|
}
|
||||||
|
11
Qt/QtHost.h
11
Qt/QtHost.h
@ -64,13 +64,12 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
virtual bool AttemptLoadSymbolMap() override {
|
virtual bool AttemptLoadSymbolMap() override {
|
||||||
return false;
|
auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart);
|
||||||
// TODO: Make this work with Qt and threaded GL... not sure what's so broken.
|
return g_symbolMap->LoadSymbolMap(fn.c_str());
|
||||||
// auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart);
|
|
||||||
// return g_symbolMap->LoadSymbolMap(fn);
|
|
||||||
}
|
}
|
||||||
void PrepareShutdown() {
|
void PrepareShutdown() {
|
||||||
g_symbolMap->SaveSymbolMap(SymbolMapFilename(PSP_CoreParameter().fileToStart));
|
auto fn = SymbolMapFilename(PSP_CoreParameter().fileToStart);
|
||||||
|
g_symbolMap->SaveSymbolMap(fn.c_str());
|
||||||
}
|
}
|
||||||
void SetWindowTitle(const char *message) override {
|
void SetWindowTitle(const char *message) override {
|
||||||
std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION;
|
std::string title = std::string("PPSSPP ") + PPSSPP_GIT_VERSION;
|
||||||
@ -91,6 +90,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const char* SymbolMapFilename(std::string currentFilename);
|
std::string SymbolMapFilename(std::string currentFilename);
|
||||||
MainWindow* mainWindow;
|
MainWindow* mainWindow;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user