Along the lines what Edward suggested, if the "origin" of the pointeris your thread, then somehow you need to make sure that memory lives
beyond the lifetime of the external, in this case C, API, context and
all, etc, etc. No room for debate in that topic; it is what it is,
deal with it in a responsible manner.