- results = cls._query(query_exec, obj, params, log_level)
+ if params_ptr is not None:
+ params = bt2_value._create_from_ptr_and_get_ref(params_ptr)
+ else:
+ params = None
+
+ priv_query_exec = bt2_query_executor._PrivateQueryExecutor(priv_query_exec_ptr)
+
+ try:
+ # this can raise, but the native side checks the exception
+ results = cls._user_query(priv_query_exec, object, params, method_obj)
+ finally:
+ # the private query executor is a private view on the query
+ # executor; it's not a shared object (the library does not
+ # offer an API to get/put a reference, just like "self"
+ # objects) from this query's point of view, so invalidate
+ # the object in case the user kept a reference and uses it
+ # later
+ priv_query_exec._invalidate()