mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Headless: Correct bad pointer without gfx context.
This commit is contained in:
parent
9bda04a0d2
commit
dedb63532b
1 changed files with 6 additions and 4 deletions
|
@ -80,8 +80,10 @@ public:
|
|||
}
|
||||
|
||||
void StopThread() override {
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_->StopThread();
|
||||
if (renderManager_) {
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_->StopThread();
|
||||
}
|
||||
}
|
||||
|
||||
void Shutdown() override {}
|
||||
|
@ -90,7 +92,7 @@ public:
|
|||
void SwapBuffers() override {}
|
||||
|
||||
private:
|
||||
Draw::DrawContext *draw_;
|
||||
Draw::DrawContext *draw_ = nullptr;
|
||||
GLRenderManager *renderManager_ = nullptr;
|
||||
SDL_Window *screen_;
|
||||
SDL_GLContext glContext_;
|
||||
|
@ -201,7 +203,7 @@ bool SDLHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext *
|
|||
|
||||
void SDLHeadlessHost::ShutdownGraphics() {
|
||||
gfx_->StopThread();
|
||||
while (threadState_ != RenderThreadState::STOPPED)
|
||||
while (threadState_ != RenderThreadState::STOPPED && threadState_ != RenderThreadState::START_FAILED)
|
||||
sleep_ms(1);
|
||||
|
||||
gfx_->Shutdown();
|
||||
|
|
Loading…
Add table
Reference in a new issue