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
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:
1 parent
fcfec0506f
commit
30b731de54
2 files changed
+3
-3
No files matched your search
@@ -161,7 +161,7 @@ namespace Jni
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeTrueUtf8(char* p) {
|
void FreeTrueUtf8(const char* p) {
|
||||||
if (p != nullptr) free(p);
|
if (p != nullptr) free((void*)p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -54,5 +54,5 @@ namespace Jni
|
|||||||
// the glyph atlas even when the glyph is registered. Caller must release with
|
// the glyph atlas even when the glyph is registered. Caller must release with
|
||||||
// FreeTrueUtf8(). Returns nullptr iff the input jstring is null.
|
// FreeTrueUtf8(). Returns nullptr iff the input jstring is null.
|
||||||
char* ToTrueUtf8(JNIEnv* env, jstring s);
|
char* ToTrueUtf8(JNIEnv* env, jstring s);
|
||||||
void FreeTrueUtf8(char* p);
|
void FreeTrueUtf8(const char* p);
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user