mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
Fix tinydisplay texture errors on shutdown
This commit is contained in:
parent
aa74caacbe
commit
2e9394eba7
@ -38,6 +38,7 @@ This issue fixes several bugs that were still found in 1.9.2.
|
|||||||
* Fix is_playing() check when playing an animation backwards
|
* Fix is_playing() check when playing an animation backwards
|
||||||
* Windows installer no longer clears %PATH% if longer than 1024 chars
|
* Windows installer no longer clears %PATH% if longer than 1024 chars
|
||||||
* Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar
|
* Fix inoperative -tbn/-tbnall/-tbnauto options in egg-optchar
|
||||||
|
* Fix tinydisplay texture errors on shutdown
|
||||||
|
|
||||||
------------------------ RELEASE 1.9.2 ------------------------
|
------------------------ RELEASE 1.9.2 ------------------------
|
||||||
|
|
||||||
|
@ -1800,24 +1800,9 @@ update_texture(TextureContext *tc, bool force, int stage_index, bool uses_mipmap
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void TinyGraphicsStateGuardian::
|
void TinyGraphicsStateGuardian::
|
||||||
release_texture(TextureContext *tc) {
|
release_texture(TextureContext *tc) {
|
||||||
TinyTextureContext *gtc = DCAST(TinyTextureContext, tc);
|
|
||||||
|
|
||||||
_texturing_state = 0; // just in case
|
_texturing_state = 0; // just in case
|
||||||
|
|
||||||
GLTexture *gltex = >c->_gltex;
|
TinyTextureContext *gtc = DCAST(TinyTextureContext, tc);
|
||||||
if (gltex->allocated_buffer != NULL) {
|
|
||||||
nassertv(gltex->num_levels != 0);
|
|
||||||
TinyTextureContext::get_class_type().dec_memory_usage(TypeHandle::MC_array, gltex->total_bytecount);
|
|
||||||
PANDA_FREE_ARRAY(gltex->allocated_buffer);
|
|
||||||
gltex->allocated_buffer = NULL;
|
|
||||||
gltex->total_bytecount = 0;
|
|
||||||
gltex->num_levels = 0;
|
|
||||||
} else {
|
|
||||||
nassertv(gltex->num_levels == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtc->dequeue_lru();
|
|
||||||
|
|
||||||
delete gtc;
|
delete gtc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,13 +26,3 @@ TinyTextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view) :
|
|||||||
_gltex.allocated_buffer = NULL;
|
_gltex.allocated_buffer = NULL;
|
||||||
_gltex.total_bytecount = 0;
|
_gltex.total_bytecount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
// Function: TinyTextureContext::Destructor
|
|
||||||
// Access: Public
|
|
||||||
// Description:
|
|
||||||
////////////////////////////////////////////////////////////////////
|
|
||||||
INLINE TinyTextureContext::
|
|
||||||
~TinyTextureContext() {
|
|
||||||
nassertv(_gltex.num_levels == 0 && _gltex.allocated_buffer == NULL && _gltex.total_bytecount == 0);
|
|
||||||
}
|
|
||||||
|
@ -17,6 +17,26 @@
|
|||||||
|
|
||||||
TypeHandle TinyTextureContext::_type_handle;
|
TypeHandle TinyTextureContext::_type_handle;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: TinyTextureContext::Destructor
|
||||||
|
// Access: Public
|
||||||
|
// Description: Releases the memory associated with the texture.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
TinyTextureContext::
|
||||||
|
~TinyTextureContext() {
|
||||||
|
GLTexture *gltex = &_gltex;
|
||||||
|
if (gltex->allocated_buffer != NULL) {
|
||||||
|
nassertv(gltex->num_levels != 0);
|
||||||
|
TinyTextureContext::get_class_type().dec_memory_usage(TypeHandle::MC_array, gltex->total_bytecount);
|
||||||
|
PANDA_FREE_ARRAY(gltex->allocated_buffer);
|
||||||
|
gltex->allocated_buffer = NULL;
|
||||||
|
gltex->total_bytecount = 0;
|
||||||
|
gltex->num_levels = 0;
|
||||||
|
} else {
|
||||||
|
nassertv(gltex->num_levels == 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: TinyTextureContext::evict_lru
|
// Function: TinyTextureContext::evict_lru
|
||||||
// Access: Public, Virtual
|
// Access: Public, Virtual
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
INLINE TinyTextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view);
|
INLINE TinyTextureContext(PreparedGraphicsObjects *pgo, Texture *tex, int view);
|
||||||
ALLOC_DELETED_CHAIN(TinyTextureContext);
|
ALLOC_DELETED_CHAIN(TinyTextureContext);
|
||||||
|
|
||||||
INLINE ~TinyTextureContext();
|
~TinyTextureContext();
|
||||||
|
|
||||||
virtual void evict_lru();
|
virtual void evict_lru();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user