Merge lp:~brandontschaefer/unity/mt-grab-handle-refrence-counting-fix-6.0 into lp:unity/6.0
Status: | Merged |
---|---|
Approved by: | Łukasz Zemczak |
Approved revision: | no longer in the source branch. |
Merged at revision: | 2783 |
Proposed branch: | lp:~brandontschaefer/unity/mt-grab-handle-refrence-counting-fix-6.0 |
Merge into: | lp:unity/6.0 |
Diff against target: |
448 lines (+53/-57) 12 files modified
plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-group.cpp (+1/-1) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-group.h (+4/-6) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-impl-factory.cpp (+2/-2) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-impl-factory.h (+3/-5) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle-window.h (+1/-1) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle.cpp (+3/-3) plugins/unity-mt-grab-handles/src/unity-mt-grab-handle.h (+6/-8) plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.cpp (+17/-13) plugins/unity-mt-grab-handles/src/unity-mt-grab-handles.h (+6/-8) plugins/unity-mt-grab-handles/src/unity-mt-texture.cpp (+2/-2) plugins/unity-mt-grab-handles/src/unity-mt-texture.h (+3/-4) tests/test_grabhandle.cpp (+5/-4) |
To merge this branch: | bzr merge lp:~brandontschaefer/unity/mt-grab-handle-refrence-counting-fix-6.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Łukasz Zemczak | Approve | ||
Review via email: mp+129573@code.launchpad.net |
Commit message
Fix reference counting problem which leads to memory leaks and a crash in MT grab handles.
Description of the change
=== Problem ===
Reference counting problem causes Window/memory leaks which causes a map to not free XIDs causing a crash (hard to reproduce)
The problem is there is a vector mGrabHandles which stores a shard_ptr then the shared_ptr is pushed inside of a map mInputHandle. So when a window closes there is more then 1 things references each grab handle window so it never gets cleaned up.
=== Fix ===
Change the map to store weak ptrs, now when a window is closed everything gets cleaned up.
=== Test ===
Working on coming up with something, a manual test wouldn't work well here since it is hard to reproduce the crash.
Ok, tested, working, not causing any regressions - but is there a known manual test to reproduce this issue?