diff --git a/src/js_realm.hpp b/src/js_realm.hpp index 8a96e862..1b5e812b 100644 --- a/src/js_realm.hpp +++ b/src/js_realm.hpp @@ -125,7 +125,6 @@ void delete_all_realms(); template class RealmClass : public ClassDefinition { - public: using GlobalContextType = typename T::GlobalContext; using ContextType = typename T::Context; using FunctionType = typename T::Function; @@ -137,6 +136,7 @@ class RealmClass : public ClassDefinition { using ReturnValue = js::ReturnValue; using NativeAccessor = realm::NativeAccessor; +public: static FunctionType create_constructor(ContextType); // methods diff --git a/src/object-store/src/results.cpp b/src/object-store/src/results.cpp index 1daa32fc..f8682b10 100644 --- a/src/object-store/src/results.cpp +++ b/src/object-store/src/results.cpp @@ -92,6 +92,8 @@ Results::~Results() bool Results::is_valid() const { + if (m_realm) + m_realm->verify_thread(); if (m_table && !m_table->is_attached()) return false; if (m_mode == Mode::TableView && (!m_table_view.is_attached() || m_table_view.depends_on_deleted_object())) @@ -104,8 +106,6 @@ bool Results::is_valid() const void Results::validate_read() const { - if (m_realm) - m_realm->verify_thread(); if (!is_valid()) throw InvalidatedException(); }