mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Remove redundant shutdown callback
This commit is contained in:
1 parent
0b5bcef6e2
commit
85c015efb8
5 files changed
+6
-44
No files matched your search
@@ -71,7 +71,6 @@ static std::mutex m_hInactiveMutex;
|
||||
|
||||
static int steppingCounter = 0;
|
||||
static std::set<CoreLifecycleFunc> lifecycleFuncs;
|
||||
static std::set<CoreStopRequestFunc> stopFuncs;
|
||||
|
||||
// This can be read and written from ANYWHERE.
|
||||
volatile CoreState coreState = CORE_STEPPING_CPU;
|
||||
@@ -106,16 +105,9 @@ void Core_NotifyLifecycle(CoreLifecycle stage) {
|
||||
}
|
||||
}
|
||||
|
||||
void Core_ListenStopRequest(CoreStopRequestFunc func) {
|
||||
stopFuncs.insert(func);
|
||||
}
|
||||
|
||||
void Core_Stop() {
|
||||
Core_ResetException();
|
||||
Core_UpdateState(CORE_POWERDOWN);
|
||||
for (auto func : stopFuncs) {
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
void Core_UpdateState(CoreState newState) {
|
||||
|
||||
@@ -107,10 +107,6 @@ typedef void (* CoreLifecycleFunc)(CoreLifecycle stage);
|
||||
void Core_ListenLifecycle(CoreLifecycleFunc func);
|
||||
void Core_NotifyLifecycle(CoreLifecycle stage);
|
||||
|
||||
// Callback is executed on requesting thread.
|
||||
typedef void (* CoreStopRequestFunc)();
|
||||
void Core_ListenStopRequest(CoreStopRequestFunc callback);
|
||||
|
||||
bool Core_IsStepping();
|
||||
|
||||
bool Core_IsActive();
|
||||
|
||||
+5
-20
@@ -289,27 +289,7 @@ int HTTPRequest::sendRequest(u32 postDataPtr, u32 postDataSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __HttpNotifyLifecycle(CoreLifecycle stage) {
|
||||
if (stage == CoreLifecycle::STOPPING) {
|
||||
for (const auto& it : httpObjects) {
|
||||
if (it->className() == name_HTTPRequest)
|
||||
(static_cast<HTTPRequest*>(it.get()))->abortRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void __HttpRequestStop() {
|
||||
// This can happen from a separate thread.
|
||||
std::lock_guard<std::mutex> guard(httpLock);
|
||||
for (const auto& it : httpObjects) {
|
||||
if (it->className() == name_HTTPRequest)
|
||||
(static_cast<HTTPRequest*>(it.get()))->abortRequest();
|
||||
}
|
||||
}
|
||||
|
||||
void __HttpInit() {
|
||||
Core_ListenLifecycle(&__HttpNotifyLifecycle);
|
||||
Core_ListenStopRequest(&__HttpRequestStop);
|
||||
}
|
||||
|
||||
void __HttpShutdown() {
|
||||
@@ -317,6 +297,11 @@ void __HttpShutdown() {
|
||||
httpInited = false;
|
||||
httpsInited = false;
|
||||
httpCacheInited = false;
|
||||
|
||||
for (const auto& it : httpObjects) {
|
||||
if (it->className() == name_HTTPRequest)
|
||||
(static_cast<HTTPRequest*>(it.get()))->abortRequest();
|
||||
}
|
||||
httpObjects.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -822,16 +822,6 @@ static bool ReadCompressed(u32 fp, void *dest, size_t sz, uint32_t version) {
|
||||
return real_size == sz;
|
||||
}
|
||||
|
||||
static void ReplayStop() {
|
||||
_dbg_assert_(!replayThread.joinable());
|
||||
|
||||
// This can happen from a separate thread.
|
||||
lastExecFilename.clear();
|
||||
lastExecCommands.clear();
|
||||
lastExecPushbuf.clear();
|
||||
lastExecVersion = 0;
|
||||
}
|
||||
|
||||
static u32 LoadReplay(const std::string &filename) {
|
||||
PROFILE_THIS_SCOPE("ReplayLoad");
|
||||
u32 fp = pspFileSystem.OpenFile(filename, FILEACCESS_READ);
|
||||
@@ -911,8 +901,6 @@ void WriteRunDumpCode(u32 codeStart) {
|
||||
ReplayResult RunMountedReplay(const std::string &filename) {
|
||||
_assert_msg_(!gpuDebug->GetRecorder()->IsActivePending(), "Cannot run replay while recording.");
|
||||
|
||||
Core_ListenStopRequest(&ReplayStop);
|
||||
|
||||
uint32_t version = lastExecVersion;
|
||||
if (lastExecFilename != filename) {
|
||||
// Does this ever happen? Can the filename change, without going through core shutdown/startup?
|
||||
|
||||
@@ -30,5 +30,6 @@ enum class ReplayResult {
|
||||
|
||||
void WriteRunDumpCode(u32 addr);
|
||||
ReplayResult RunMountedReplay(const std::string &filename);
|
||||
void ReplayShutdown();
|
||||
|
||||
} // namespace GPURecord
|
||||
Reference in new issue
Block a user