Code review comment for lp:~nick-dedekind/unity8/sharedunitymenumodel

Revision history for this message
Nick Dedekind (nick-dedekind) wrote :

> I looked at this briefly today. My comment from earlier still stands -- it's
> unsafe to assume Qml won't delete the singleton object you pass it. For
> example, if the Qml that loaded the plugin is destroyed, so will the plugin's
> objects.
>
> Since you use ::singleton() calls elsewhere in code, you can't just give Qml a
> new object when it asks and outsource singleton-enforcement to Qml. But can
> you use a QPointer object as a return? I think it expects a QObject * pointer
> directly...

The only places that use the singleton are in the plugin, so I don't think plugin unloading is an issue? All the SharedUnityMenuModels will have been destroyed by then. I need to merge this with your greeter branch soon anyway, so i'm guessing the shared models will be parented to the cache anyway...

Might be able to use QPointer as the static and give Qml the raw one...

« Back to merge proposal