Get rid of QWeakPointer
ClosedPublic

Authored by denisshienkov on Mar 7 2017, 7:26 PM.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
denisshienkov created this revision.Mar 7 2017, 7:26 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 7 2017, 7:26 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
denisshienkov added a reviewer: afiestas.
denisshienkov added a reviewer: ltoscano.
volkov edited edge metadata.Mar 8 2017, 12:26 PM

From the the documentation of QObject::~QObject: "Warning: Deleting a QObject while pending events are waiting to be delivered can cause a crash."

It can happens only if an object lives in a different thread. But the ErrorOverlay - is a widget, which should live in a main thread.

From the the documentation of QObject::~QObject: "Warning: Deleting a QObject while pending events are waiting to be delivered can cause a crash."

It can happens only if an object lives in a different thread. But the ErrorOverlay - is a widget, which should live in a main thread.

That is not true.

If I have two things that connect to the same signal, I get two things in my event queue. Multiple things in the event queue happens all the time.
If one slot deletes something another second slot implicitly relies on, I can get a crash, no threads needed.

In this particular case as nothing is connected to that widget it seems you're right it wont' be a problem, but not for the reason you said.

FWIW, QPointer is the natural replacement for QWeakPointer and it has practically no overhead.

denisshienkov edited the summary of this revision. (Show Details)
davidedmundson accepted this revision.Mar 9 2017, 4:52 PM
This revision is now accepted and ready to land.Mar 9 2017, 4:52 PM

What is next steps from my side?

aacid requested changes to this revision.Mar 11 2017, 4:20 PM
aacid added a subscriber: aacid.

What repository is this patch for?

This revision now requires changes to proceed.Mar 11 2017, 4:20 PM
cfeck set the repository for this revision to R122 Powerdevil.Mar 11 2017, 4:48 PM
aacid resigned from this revision.Mar 11 2017, 4:59 PM

Ok, abstaining.

David you should commit it since AFAICS Denis does not have commit access.

This revision is now accepted and ready to land.Mar 11 2017, 4:59 PM

Can I get a "commit access"? If yes, then how? I have read many WiKi's pages about KDE commit policy and so on.. But I did not understand how it works with KDE? Could you please recommend for me some appropriate wiki?

PS: I know how to work with Qt's JIRA, but the KDE's confused for me. :)

aacid removed a subscriber: aacid.Mar 11 2017, 5:47 PM

https://community.kde.org/Infrastructure/Get_a_Developer_Account

"After you obtained your KDE Identity, visit the Developer Application page to apply for a KDE Developer Account."
"Normally, any developer who has done some work on projects hosted by KDE can apply for a KDE Developer account. "

I don't think that one commit is enough, but KDE developers can commit instead of you.
Don't stuck on one change.

mart added a subscriber: mart.Mar 13 2017, 9:57 AM
This comment was removed by mart.
mart added a comment.Mar 13 2017, 9:58 AM

pushed the patch.
you are encouraged anyways to apply for a developer account!

This revision was automatically updated to reflect the committed changes.