mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Minor safety check
This commit is contained in:
parent
c54999d26a
commit
7e9bc84c06
1 changed files with 4 additions and 3 deletions
|
@ -14,7 +14,7 @@ enum ImageFileType {
|
|||
|
||||
class ManagedTexture : public GfxResourceHolder {
|
||||
public:
|
||||
ManagedTexture(Draw::DrawContext *draw) : draw_(draw), texture_(nullptr) {
|
||||
ManagedTexture(Draw::DrawContext *draw) : draw_(draw) {
|
||||
if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL)
|
||||
register_gl_resource_holder(this, "managed_texture", 0);
|
||||
}
|
||||
|
@ -25,7 +25,8 @@ public:
|
|||
unregister_gl_resource_holder(this);
|
||||
}
|
||||
void GLLost() override {
|
||||
texture_->Release();
|
||||
if (texture_)
|
||||
texture_->Release();
|
||||
texture_ = nullptr;
|
||||
}
|
||||
void GLRestore() override {
|
||||
|
@ -49,7 +50,7 @@ public:
|
|||
int Height() const { return texture_->Height(); }
|
||||
|
||||
private:
|
||||
Draw::Texture *texture_;
|
||||
Draw::Texture *texture_ = nullptr;
|
||||
Draw::DrawContext *draw_;
|
||||
std::string filename_; // Textures that are loaded from files can reload themselves automatically.
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue