gobj: fix crash printing out residency trackers

This commit is contained in:
rdb 2019-11-10 19:23:10 +01:00
parent 2d836697b0
commit ccca3cca3a
2 changed files with 14 additions and 2 deletions

View File

@ -20,7 +20,13 @@ TypeHandle IndexBufferContext::_type_handle;
*/
void IndexBufferContext::
output(std::ostream &out) const {
out << *get_data() << ", " << get_data_size_bytes();
GeomPrimitive *prim = get_data();
if (prim != nullptr) {
out << *prim;
} else {
out << "NULL";
}
out << ", " << get_data_size_bytes();
}
/**

View File

@ -21,7 +21,13 @@ TypeHandle VertexBufferContext::_type_handle;
*/
void VertexBufferContext::
output(std::ostream &out) const {
out << *get_data() << ", " << get_data_size_bytes();
GeomVertexArrayData *data = get_data();
if (data != nullptr) {
out << *data;
} else {
out << "NULL";
}
out << ", " << get_data_size_bytes();
}
/**