diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-03-30 21:19:46 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-03-31 13:34:28 +0200 |
commit | 48cf7ccd69abcc5b605a8ea634a0e8e9e1e04864 (patch) | |
tree | a01667db5ddfa5859c7209f29666555ae94c61b3 | |
parent | 6730907167e37c3c4ea7e492482691e993b34ba2 (diff) | |
download | vd_agent-48cf7ccd69abcc5b605a8ea634a0e8e9e1e04864.tar.gz vd_agent-48cf7ccd69abcc5b605a8ea634a0e8e9e1e04864.tar.xz vd_agent-48cf7ccd69abcc5b605a8ea634a0e8e9e1e04864.zip |
vdagent-x11: move freeing of incr data sending buffers out of next_selection_request
-rw-r--r-- | vdagent-x11.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/vdagent-x11.c b/vdagent-x11.c index 7511cd2..854f5fa 100644 --- a/vdagent-x11.c +++ b/vdagent-x11.c @@ -251,13 +251,6 @@ int vdagent_x11_get_fd(struct vdagent_x11 *x11) static void vdagent_x11_next_selection_request(struct vdagent_x11 *x11) { struct vdagent_x11_selection_request *selection_request; - - free(x11->selection_req_data); - x11->selection_req_data = NULL; - x11->selection_req_data_pos = 0; - x11->selection_req_data_size = 0; - x11->selection_req_atom = None; - selection_request = x11->selection_req; x11->selection_req = selection_request->next; free(selection_request); @@ -284,6 +277,11 @@ static void vdagent_x11_set_clipboard_owner(struct vdagent_x11 *x11, vdagent_x11_next_selection_request(x11); } } + free(x11->selection_req_data); + x11->selection_req_data = NULL; + x11->selection_req_data_pos = 0; + x11->selection_req_data_size = 0; + x11->selection_req_atom = None; if (x11->conversion_req) { fprintf(x11->errfile, "client clipboard request pending on clipboard ownership " @@ -968,6 +966,11 @@ static void vdagent_x11_handle_property_delete_notify(struct vdagent_x11 *x11, incr transfer is done. Hence we do not check if we've send all data but instead check we've send the final 0 sized XChangeProperty. */ if (len == 0) { + free(x11->selection_req_data); + x11->selection_req_data = NULL; + x11->selection_req_data_pos = 0; + x11->selection_req_data_size = 0; + x11->selection_req_atom = None; vdagent_x11_next_selection_request(x11); vdagent_x11_handle_selection_request(x11); } |