Fixes several resource leaks in ...

- gdscript
- gdscript_compiler
- regex
- android/export
- gles3/rasterizer (scene and storage)
This commit is contained in:
Crazy-P
2018-08-26 09:19:02 +08:00
parent 8c435a343e
commit e4af39cbc0
6 changed files with 48 additions and 6 deletions

View File

@ -205,6 +205,8 @@ Error RegEx::compile(const String &p_pattern) {
code = pcre2_compile_16(p, pattern.length(), flags, &err, &offset, cctx);
pcre2_compile_context_free_16(cctx);
if (!code) {
PCRE2_UCHAR16 buf[256];
pcre2_get_error_message_16(err, buf, 256);
@ -221,6 +223,8 @@ Error RegEx::compile(const String &p_pattern) {
code = pcre2_compile_32(p, pattern.length(), flags, &err, &offset, cctx);
pcre2_compile_context_free_32(cctx);
if (!code) {
PCRE2_UCHAR32 buf[256];
pcre2_get_error_message_32(err, buf, 256);
@ -285,6 +289,8 @@ Ref<RegExMatch> RegEx::search(const String &p_subject, int p_offset, int p_end)
if (res < 0) {
pcre2_match_data_free_32(match);
pcre2_match_context_free_32(mctx);
return NULL;
}