Skip to content
Commit fac27b49 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

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
parent 07b1e86b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment