Page MenuHomePhorge

Fix possibly dangling reference to a temporary
ClosedPublic

Authored by tusooa on Jun 19 2024, 8:38 PM.

Details

Summary

These two are <function that returns JsonWrap>.get(), where the JsonWrap is a temporary. We got lucky because the shared internal structure stored in the JsonWrap happens to have not been destroyed. This commit stores a local JsonWrap first, and then get a json reference out of it. This helps avoid the extra copy of the json while ensuring the shared structure does not get destroyed.

Type: fix

CCBUG: https://iron.lily-is.land/T15

Test Plan

Verify that the build logs does not have -Wdangling-reference warnings.

Diff Detail

Repository
rL libkazv
Branch
tusooa/stacked
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 89
Build 167: GitLab CI for libkazv
Build 166: arc lint + arc unit