Raise if context's native Context has already been destroyed.
Plugin models pass context.getNativePtr() to a C++ constructor that stores the raw pointer for the lifetime of the model. Destroying the Context (via __exit__, __del__, or garbage collection) frees that memory without invalidating the model's copy, so any later call dereferences freed memory and segfaults.
Models must hold a Python reference to the owning Context (keeping it alive) and call this before every native call (turning an explicit close into an actionable error instead of a crash).
- Parameters
-
| context | The Context the model was constructed from. |
| owner_name | Class name of the calling model, used in the message. |
- Exceptions
-
| RuntimeError | If the Context has been destroyed. |
Definition at line 6181 of file Context.py.