~/talk

C++ and Objective C++ Gotachs

Talkat CppCon 2019 · 2019-09-15..09-20· [software-architecture]
links:none on file
slides:none on file

Clang auto-fixes a void cast to an Objective‑C object by inserting __bridge, which lets ARC release the object prematurely and creates a use‑after‑free when C++ code runs on a new thread; the fix is to pass the object with __bridge_retained into C++ and return it with __bridge_transfer so ARC ownership moves safely across the boundary. For capturing C++ objects in Objective‑C blocks, replace naive weak references with a pattern using shared_from_this/weak_ptr* to create a weak capture, lock it to a strong pointer inside the block, and avoid races and crashes.

AI-written summary · about

~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.