C++ Add a few asserts that the non-thread safe API is not called in a thread

This commit is contained in:
Olivier Goffart 2021-08-12 12:10:56 +02:00 committed by Olivier Goffart
parent 220f8ec473
commit 9b869f2dc0
2 changed files with 27 additions and 4 deletions

View file

@ -567,6 +567,7 @@ class ComponentInstance : vtable::Dyn
// ComponentHandle<ComponentInstance> is in fact a VRc<ComponentVTable, ErasedComponentBox>
const cbindgen_private::ErasedComponentBox *inner() const
{
sixtyfps::private_api::assert_main_thread();
return reinterpret_cast<const cbindgen_private::ErasedComponentBox *>(this);
}