Merge lp:~3v1n0/bamf/factory-ref-rework into lp:bamf
Status: | Merged |
---|---|
Approved by: | Ted Gould |
Approved revision: | 569 |
Merged at revision: | 547 |
Proposed branch: | lp:~3v1n0/bamf/factory-ref-rework |
Merge into: | lp:bamf |
Diff against target: |
451 lines (+164/-87) 4 files modified
debian/changelog (+9/-10) lib/libbamf/bamf-factory.c (+135/-75) lib/libbamf/bamf-view.c (+19/-1) src/bamf-matcher.c (+1/-1) |
To merge this branch: | bzr merge lp:~3v1n0/bamf/factory-ref-rework |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andrea Azzarone (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Ted Gould (community) | Approve | ||
Review via email: mp+169193@code.launchpad.net |
Commit message
BamfFactory: fix references of allocated/closed views; improve re-matching of views
Now the ownership of the open views is in the hash-table, closed views must be owned
by clients (if they want to). The factory also tracks the allocated views until they
don't get destroyed to re-use them if possible.
Description of the change
The factory was owning the views it allocated in the bad way, and was re-opening closed views without taking the ownership of them.
Now the ownership of the open views is in the hash-table, closed views must be owned by clients (if they want to). The factory also tracks the allocated views until they don't get destroyed to re-use them if possible.
Added closed view re-matching by application name (only if the name is unique).
When the bamfdaemon is killed / stopped now all the views are set as closed, so that they can be correctly re-matched.
You can use this test-binary to check what happens in libbamf: http://
Together with a script like
count=0; while [ $count -lt 20 ]; do xclock& sleep 0.3 && kill $(pidof xclock); count=$((count+1)); done
Can give some informations..
Really worried about reference leaks there, but I can't find any. You should probably consider in the future adding some tests that make sure you're not keeping any internal references of objects.