Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Prevent ByteArray and UtfString from being prematurely cleaned up #12346

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/controller/java/templates/partials/decode_value.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ if ({{source}}.Value().IsNull()) {
{{else if isStruct}}
{{asSymbol label}} = nullptr; /* Struct - conversion from this type to Java is not properly implemented yet */
{{else if (isOctetString type)}}
{{target}} = chip::ByteArray(env, {{>item}}).jniValue();
chip::ByteArray {{target}}ByteArray(env, {{>item}});
{{target}} = {{target}}ByteArray.jniValue();
{{else if (isCharString type)}}
{{target}} = chip::UtfString(env, {{>item}}).jniValue();
chip::UtfString {{target}}UtfString(env, {{>item}});
{{target}} = {{target}}UtfString.jniValue();
{{else}}
std::string {{target}}ClassName = "java/lang/{{asJavaBasicTypeForZclType type true}}";
std::string {{target}}CtorSignature = "({{asJniSignature type false}})V";
Expand Down
96 changes: 64 additions & 32 deletions src/controller/java/zap-generated/CHIPInvokeCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/controller/java/zap-generated/CHIPReadCallbacks.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.