mirror of
https://github.com/godotengine/godot.git
synced 2024-11-17 01:23:18 +00:00
Fix memory leak when using CurveTexture.set_texture_mode
This commit is contained in:
parent
efbbd14af3
commit
10818cfc10
@ -625,6 +625,8 @@ void RasterizerStorageGLES3::texture_replace(RID p_texture, RID p_by_texture) {
|
||||
for (int n = 0; n < tex_from->images.size(); n++) {
|
||||
texture_set_data(p_texture, tex_from->images[n], n);
|
||||
}
|
||||
|
||||
free(p_by_texture);
|
||||
}
|
||||
|
||||
bool RasterizerStorageGLES3::_is_main_thread() {
|
||||
|
@ -1503,6 +1503,7 @@ Ref<Curve> CurveTexture::get_curve() const {
|
||||
}
|
||||
|
||||
void CurveTexture::set_texture_mode(TextureMode p_mode) {
|
||||
ERR_FAIL_COND(p_mode < TEXTURE_MODE_RGB || p_mode > TEXTURE_MODE_RED);
|
||||
if (texture_mode == p_mode) {
|
||||
return;
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public:
|
||||
Ref<Image> texture_2d_layer_get(RID p_texture, int p_layer) const override { return Ref<Image>(); }
|
||||
Vector<Ref<Image>> texture_3d_get(RID p_texture) const override { return Vector<Ref<Image>>(); }
|
||||
|
||||
void texture_replace(RID p_texture, RID p_by_texture) override {}
|
||||
void texture_replace(RID p_texture, RID p_by_texture) override { free(p_by_texture); }
|
||||
void texture_set_size_override(RID p_texture, int p_width, int p_height) override {}
|
||||
|
||||
void texture_set_path(RID p_texture, const String &p_path) override {}
|
||||
|
Loading…
Reference in New Issue
Block a user