QmlObject: Use std::shared_ptr to properly track the lifetime of QQmlEngine
The engine passed to QmlObject is potentially shared, either because it comes from QmlObjectSharedEngine or because the caller is already using it. Since raw pointers do not provide any information about that, deprecate the raw pointer constructors and replace them with a constructor taking a std::shared_ptr. This allows QmlObject to properly track if its the first user of the QQmlEngine and if so, call KDeclarative::setupEngine on it. It also allows it to know if it is the *last* user of the engine, and in that case properly cleanup the QNAM factory, without affecting the shared engine case. BUG: 451790
Loading
Please register or sign in to comment