Discard Deleted before Scene is destroyed
ClosedPublic

Authored by zzag on Feb 10 2019, 10:58 PM.

Details

Summary

Deleted has lifetime bounded to effects and scene.

We can't discard Deleted before EffectsHandler is destroyed because
effects that referenced it may call unrefWindow.

On the other hand, the fact that Deleted may outlive scene doesn't
make sense because Deleted exist purely for animation purposes and
nothing more.

This change arranges lifetime of Deleted so it's more reasonable.

Diff Detail

Repository
R108 KWin
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8284
Build 8302: arc lint + arc unit
zzag created this revision.Feb 10 2019, 10:58 PM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 10 2019, 10:58 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Feb 10 2019, 10:58 PM
zzag added a comment.Feb 10 2019, 11:02 PM

KWin/Wayland still crashes in ~SceneOpenGLDecorationRenderer, but that's unrelated to this patch.

graesslin added inline comments.
composite.cpp
389–390

why remove these?

zzag added inline comments.Feb 11 2019, 5:21 PM
composite.cpp
389–390

If a Deleted is discarded, it will be removed from the scene as well, so we don't need these lines.

zzag updated this revision to Diff 51671.Feb 14 2019, 12:57 PM

Rebase on master; fix merge conflicts.

zzag updated this revision to Diff 51672.Feb 14 2019, 1:02 PM

Bad update (it should be against 5.15).

zzag edited the summary of this revision. (Show Details)Feb 21 2019, 11:01 AM
zzag updated this revision to Diff 52856.Feb 28 2019, 9:08 PM
zzag edited the summary of this revision. (Show Details)

Apparently I fixed bug 404176 without knowing it.
See 9a68cbd9b110b529021c128ea6650ce6774f462a.

Though I still think that it's worth to have this change in
kwin because it makes lifetime of Deleted logically correct.

zzag edited the summary of this revision. (Show Details)Feb 28 2019, 9:10 PM
davidedmundson accepted this revision.Mar 1 2019, 12:36 AM
This revision is now accepted and ready to land.Mar 1 2019, 12:36 AM
This revision was automatically updated to reflect the committed changes.