diff options
| author | Hans de Goede <hdegoede@redhat.com> | 2012-03-10 12:06:39 +0100 |
|---|---|---|
| committer | Hans de Goede <hdegoede@redhat.com> | 2012-03-10 13:56:29 +0100 |
| commit | 63e1514ccbcdbf122c4f61f5a9511db586b7ae0d (patch) | |
| tree | 72f8fb74a530d9d4c19d745acbd8f37453160412 /python_modules/codegen.py | |
| parent | f24203e122c756e3b3ee540c718409451e4f9458 (diff) | |
| download | spice-63e1514ccbcdbf122c4f61f5a9511db586b7ae0d.tar.gz spice-63e1514ccbcdbf122c4f61f5a9511db586b7ae0d.tar.xz spice-63e1514ccbcdbf122c4f61f5a9511db586b7ae0d.zip | |
red_worker: Remove ref counting from the EventListener struct
The red_worker EventListener struct is either embedded in one of:
1) DisplayChannelClient
2) CursorChannelClient
3) RedWorker
And as such gets destroyed when these get destroyed, in case 1 & 2 through
a call to red_channel_client_destroy().
So free-ing it when the ref-count becomes 0 is wrong, for cases:
1) and 2) this will lead to a double free;
3) this will lead to passing memory to free which was not returned by malloc.
This is not causing any issues as the ref-count never gets decremented, other
then in red_worker_main where it gets incremented before it gets decremented,
so it never becomes 0.
So we might just as well completely remove it.
Notes:
1) This is mainly a preparation patch for fixing issues introduced by
the move from epoll to poll
2) Since removing the ref-counting removes the one code path where listeners
would get set to NULL, this patch moves the setting of NULL to
pre_disconnect, where it should have been done in the first place since
red_client_destroy calls red_channel_client_disconnect
(through the dispatcher) followed by red_channel_client_destroy, so
after pre_disconnect the listener may be gone.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'python_modules/codegen.py')
0 files changed, 0 insertions, 0 deletions
