fix: make Jni::FreeTrueUtf8 const-safe
CI / Build Java (push) Has been cancelled
CI / Build Native (macos-latest - macos) (push) Has been cancelled
CI / Build Native (ubuntu-latest - linux) (push) Has been cancelled
CI / Build Native (ubuntu-latest - windows) (push) Has been cancelled
CI / Archive Natives (push) Has been cancelled
CI / Update Binaries (push) Has been cancelled
CI / Release (push) Has been cancelled

TextEditor/TextEditorLanguageDefinition use 'const char* value =
env->GetStringUTFChars(...)' then release via the same pointer. After
the mass replace the release side called FreeTrueUtf8(char*) with a
const char* argument, which fails to compile. Switch the helper
signature to take const char* so both const and non-const call sites
build.
This commit is contained in:
MRLokop committed 2026-04-20 11:27:00 +03:00
1 parent fcfec0506f
commit 30b731de54
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -161,7 +161,7 @@ namespace Jni
return buf;
}
void FreeTrueUtf8(char* p) {
if (p != nullptr) free(p);
void FreeTrueUtf8(const char* p) {
if (p != nullptr) free((void*)p);
}
}
+1 -1
View File
@@ -54,5 +54,5 @@ namespace Jni
// the glyph atlas even when the glyph is registered. Caller must release with
// FreeTrueUtf8(). Returns nullptr iff the input jstring is null.
char* ToTrueUtf8(JNIEnv* env, jstring s);
void FreeTrueUtf8(char* p);
void FreeTrueUtf8(const char* p);
}