« Return to Thread: Review Request: Use smart pointers to protect access to TabBoxClient

Re: Review Request: Use smart pointers to protect access to TabBoxClient

by Commit Hook-2 :: Rate this Message:

| View in Thread

This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/105000/

This review has been submitted with commit 19c0fa5abd90a46de2ef6949a15de31111f930f4 by Martin Gräßlin to branch KDE/4.8.

- Commit


On May 20th, 2012, 3:28 p.m., Martin Gräßlin wrote:

Review request for kwin.
By Martin Gräßlin.

Updated May 20, 2012, 3:28 p.m.

Description

Use smart pointers to protect access to TabBoxClient

Client holds a SharedPointer to the TabBoxClient and only
provides access to a WeakPointer which is passed to TabBox.
ClientModel is adjusted to hold a list of WeakPointers instead
of the direct pointers.

This fixes the following reproducable crash:
1. Configure both primary and secondary TabBox with different
   layouts
2. Use primary TabBox
3. Close a window, best the one which used to be active
4. Use secondary TabBox
-> Crash

The reason is that the ClientModel still contains the pointer
to the deleted TabBoxClient in step 3 and while creating the
layout access to the TabBoxClient is needed to get the Client's
icon.

By using the weak pointer it can be ensured that we don't try
to dereference the deleted pointer and prevent the crash.

BUG: 290482
BUG: 285747
CCBUG: 237345
FIXED-IN: 4.8.4
Bugs: 237345, 285747, 290482

Diffs

  • kwin/client.h (0f0e9b8a930b4b672f7305fb985e54b702c283b1)
  • kwin/client.cpp (820a232b8bf5d3543e3a4dffc9d2b0b30edf291e)
  • kwin/tabbox/clientmodel.h (6d646ab4d29df033b351763017f2051157e0198b)
  • kwin/tabbox/clientmodel.cpp (b3f895421281b8b292551217d5905236547b4340)
  • kwin/tabbox/tabbox.h (70c30e447b5578108137e8dd5695448469647a3c)
  • kwin/tabbox/tabbox.cpp (62b9df0efda0fef38c64453bdc4cd7589109adb4)
  • kwin/tabbox/tabboxhandler.h (14427e8ca6d1b22a25db4859bc19e79ccbd8235c)
  • kwin/tabbox/tabboxhandler.cpp (cd21484f5980f28b314a89c629f339795afa0805)

View Diff


_______________________________________________
kwin mailing list
kwin@...
https://mail.kde.org/mailman/listinfo/kwin

 « Return to Thread: Review Request: Use smart pointers to protect access to TabBoxClient