gobj: fix crash with ShaderBuffer

This commit is contained in:
rdb 2017-12-24 12:41:52 +01:00
parent ed5e5386b9
commit 540122e703
3 changed files with 14 additions and 2 deletions

View File

@ -19,7 +19,8 @@ INLINE ShaderBuffer::
ShaderBuffer(const string &name, uint64_t size, UsageHint usage_hint) : ShaderBuffer(const string &name, uint64_t size, UsageHint usage_hint) :
Namable(name), Namable(name),
_data_size_bytes(size), _data_size_bytes(size),
_usage_hint(usage_hint) { _usage_hint(usage_hint),
_contexts(nullptr) {
} }
/** /**
@ -31,7 +32,8 @@ ShaderBuffer(const string &name, pvector<unsigned char> initial_data, UsageHint
Namable(name), Namable(name),
_data_size_bytes(initial_data.size()), _data_size_bytes(initial_data.size()),
_usage_hint(usage_hint), _usage_hint(usage_hint),
_initial_data(initial_data) { _initial_data(initial_data),
_contexts(nullptr) {
} }
/** /**

View File

@ -16,6 +16,14 @@
TypeHandle ShaderBuffer::_type_handle; TypeHandle ShaderBuffer::_type_handle;
/**
* Destructor.
*/
ShaderBuffer::
~ShaderBuffer() {
release_all();
}
/** /**
* *
*/ */

View File

@ -32,6 +32,8 @@ private:
INLINE ShaderBuffer() DEFAULT_CTOR; INLINE ShaderBuffer() DEFAULT_CTOR;
PUBLISHED: PUBLISHED:
~ShaderBuffer();
INLINE explicit ShaderBuffer(const string &name, uint64_t size, UsageHint usage_hint); INLINE explicit ShaderBuffer(const string &name, uint64_t size, UsageHint usage_hint);
INLINE explicit ShaderBuffer(const string &name, pvector<unsigned char> initial_data, UsageHint usage_hint); INLINE explicit ShaderBuffer(const string &name, pvector<unsigned char> initial_data, UsageHint usage_hint);