We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 872cfcd commit a9c3b6bCopy full SHA for a9c3b6b
src/flamegpu/visualiser/ui/Text.cpp
@@ -376,8 +376,14 @@ Text::TextureString::TextureString()
376
}
377
void Text::TextureString::resize(const glm::uvec2 &_dimensions) {
378
this->dimensions = _dimensions;
379
- if (texture)
+ if (texture) {
380
+ if (texture[0]) {
381
+ free(texture[0]);
382
+ texture[0] = nullptr;
383
+ }
384
free(texture);
385
+ texture = nullptr;
386
387
texture = reinterpret_cast<unsigned char**>(malloc(sizeof(char*) * this->dimensions.y));
388
texture[0] = reinterpret_cast<unsigned char*>(malloc(sizeof(char) * this->dimensions.x * this->dimensions.y));
389
memset(texture[0], 0, sizeof(char)*this->dimensions.x*this->dimensions.y);
0 commit comments