rive-app / rive-cpp

C++ runtime for Rive
MIT License
278 stars 42 forks source link

Explore reference counting API objects #348

Open mikerreed opened 2 years ago

mikerreed commented 2 years ago

Today we return some objects that have bare back-pointers to other objects. This is fragile, and can allow a sloppy client to accidentally delete the parent object, but still try to reference the child (whose back-pointer is not dangling).

Idea

Specifics

If this works out, the SDKs will not need to do anything. If this does not workout, we may need to modify the SDKs' high-level "wrapper" objects to keep references to the parent objects, to avoid this dangling problem.