spice/server
Frediano Ziglio dfaf83235f display: make get_drawable symmetric to display_channel_drawable_unref
Make possible to safely call display_channel_drawable_unref straight
after calling get_drawable.

Problem was function definitions and dependency.

display_channel_drawable_try_new is supposed to return an uninitialized
pointer (or NULL on failure) to a Drawable structure.

(display_channel_)get_drawable is supposed to return an initialized
pointer (or NULL) to a Drawable structure.

(display_channel_)add_drawable is supposed to add the Drawable to the
list/tree of drawing to draw.

Now, with these definitions after get_drawable the Drawable state (if
pointer is not NULL) should be consistent and we should be able to call
display_channel_drawable_unref.

In the current code this was not true as for instance surface_id was
copied to Drawable but the reference counter of the surface was not
incremented leading possible unref call to decrement the counter and
free the surface. This can happen if any call between get_drawable and
unref does not increment the reference in a consistent way. This
basically means that every present or future code in the path between
get_drawable and unref have to know this unconsistency and handle it.
This is a maintaining problem as people need to know these details when
editing existing code (actually this is display_channel_add_drawable
code).
This basically create a dependency between get_drawable and
add_drawable.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:51:18 +00:00
..
tests Add missing license headers 2015-10-19 14:25:36 +02:00
.gitignore Update the .gitignore files for the new manual, 2015-10-16 15:48:23 -05:00
agent-msg-filter.c server: Add support for filtering out agent file-xfer msgs (rhbz#961848) 2013-06-06 16:07:30 +02:00
agent-msg-filter.h server: Add support for filtering out agent file-xfer msgs (rhbz#961848) 2013-06-06 16:07:30 +02:00
cache-item.h server: split cache-item.h 2015-10-23 16:32:57 +01:00
cache-item.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
char_device.c char-device: set to NULL freed pointers on destroy 2015-11-13 12:01:26 +01:00
char_device.h Add missing license headers 2015-10-19 14:25:36 +02:00
cursor-channel.c worker: change red_worker_new_channel result to CommonChannel* 2015-12-03 10:41:46 +00:00
cursor-channel.h server: make more of cursor private 2015-11-03 09:07:18 +00:00
dcc-encoders.c dcc: remove possible dandling pointers 2015-11-24 17:00:18 +00:00
dcc-encoders.h worker: move dcc_handle_message 2015-11-24 08:55:59 +00:00
dcc-send.c dcc: reduce statement wrapping 2015-12-03 10:41:46 +00:00
dcc.c worker: move more stream functions 2015-11-26 15:19:03 +00:00
dcc.h red_worker: make dcc_clear_surface_drawables_from_pipe declaration consistent with definition 2015-12-02 12:52:10 +00:00
demarshallers.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
dispatcher.c dispatcher: Remove unused dispatcher_read_message 2015-11-23 11:45:20 +00:00
dispatcher.h server: cleanups 2015-11-27 11:49:56 +00:00
display-channel.c display: make get_drawable symmetric to display_channel_drawable_unref 2015-12-03 23:51:18 +00:00
display-channel.h display: move more logic in display_channel_get_drawable() 2015-12-03 10:41:46 +00:00
display-limits.h worker: start a DisplayChannelClient unit 2015-11-19 12:43:02 +00:00
glz_encoder_config.h Remove use of INLINE 2015-08-20 17:10:49 +01:00
glz_encoder_dictionary_protected.h glz: WindowImageSegment lines lines_end as void* 2015-08-20 11:09:00 +01:00
glz_encoder_dictionary.c fix spelling mistakes in comments (reseting to resetting & dummym to dummy) 2015-10-19 12:59:12 +01:00
glz_encoder_dictionary.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
glz_encoder.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
glz_encoder.h syntax-check: Don't use tabs for indentation 2015-10-19 14:25:36 +02:00
glz-encode-match.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
glz-encode.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
inputs_channel.c server/inputs_channel: Cope with NULL keyboard in release_keys() 2015-08-12 10:28:57 +02:00
inputs_channel.h Remove trailing blank lines 2012-01-13 18:11:59 +02:00
jpeg_encoder.c mjpeg and jpeg encoder: fix alignment warnings 2015-08-20 11:22:59 +01:00
jpeg_encoder.h Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
lz4_encoder.c LZ4: Send the original format with the compressed data 2015-02-03 10:39:16 +01:00
lz4_encoder.h LZ4: Send the original format with the compressed data 2015-02-03 10:39:16 +01:00
main_channel.c main channel: Remove unused main_channel_client_get_link_id 2015-11-23 11:52:04 +00:00
main_channel.h main channel: Remove unused main_channel_client_get_link_id 2015-11-23 11:52:04 +00:00
main_dispatcher.c Add missing license headers 2015-10-19 14:25:36 +02:00
main_dispatcher.h Add missing license headers 2015-10-19 14:25:36 +02:00
Makefile.am server: cleanups 2015-11-27 11:49:56 +00:00
migration_protocol.h migration_protocol: use SPICE_MAGIC_CONST 2015-08-20 10:54:56 +01:00
mjpeg_encoder.c server: Reuse red_get_monotonic_time() in the MJPEG video encoder 2015-12-03 15:35:06 +00:00
mjpeg_encoder.h server: Hide the MJPEG encoder internals from red_worker.c 2015-10-30 15:35:47 +01:00
pixmap-cache.c syntax-check: Add missing #include <config.h> 2015-10-19 14:25:36 +02:00
pixmap-cache.h server: cleanups 2015-11-27 11:49:56 +00:00
red_channel.c red channel: Remove unused red_channel_apply_clients_data 2015-11-23 11:50:13 +00:00
red_channel.h red channel: Remove unused red_channel_apply_clients_data 2015-11-23 11:50:13 +00:00
red_common.h server: move LZ_IMAGE_TYPE_* enum to dcc 2015-11-26 14:59:51 +00:00
red_dispatcher.c server: cleanups 2015-11-27 11:49:56 +00:00
red_dispatcher.h red dispatcher: Remove unused declaration of red_dispatcher_set_mm_time 2015-11-23 11:46:22 +00:00
red_memslots.c memslot: prefix memslot functions with memslot_ 2015-12-03 10:41:46 +00:00
red_memslots.h memslot: prefix memslot functions with memslot_ 2015-12-03 10:41:46 +00:00
red_parse_qxl.c memslot: prefix memslot functions with memslot_ 2015-12-03 10:41:46 +00:00
red_parse_qxl.h worker: move compress to dcc_compress_image() 2015-11-20 09:49:49 +00:00
red_record_qxl.c memslot: prefix memslot functions with memslot_ 2015-12-03 10:41:46 +00:00
red_record_qxl.h server/red_{record, replay}.[ch]: introduce 2015-08-21 09:38:44 +01:00
red_replay_qxl.c replay: fix formatting string 2015-09-08 10:16:12 +01:00
red_replay_qxl.h server/red_{record, replay}.[ch]: introduce 2015-08-21 09:38:44 +01:00
red_worker.c worker: rename process_commands process_display 2015-12-03 10:48:42 +00:00
red_worker.h worker: change red_worker_new_channel result to CommonChannel* 2015-12-03 10:41:46 +00:00
reds_stream.c syntax-check: Don't use tabs for indentation 2015-10-19 14:25:36 +02:00
reds_stream.h reds-stream: add reds_stream_get_family() function 2015-01-15 18:29:36 +01:00
reds_sw_canvas.c Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds_sw_canvas.h Remove unused SPICE_CANVAS_INTERNAL 2014-12-03 18:32:04 +01:00
reds-private.h Add missing license headers 2015-10-19 14:25:36 +02:00
reds.c server: remove OpenGL 2015-11-21 13:50:46 +00:00
reds.h server: remove OpenGL 2015-11-21 13:50:46 +00:00
smartcard.c smartcard: include libcacard.h if possible 2015-12-02 17:48:49 +01:00
smartcard.h Remove spice-experimental 2015-01-15 18:34:26 +01:00
snd_worker.c Remove unused snd_get_playback_compression() method 2015-08-11 17:24:36 +02:00
snd_worker.h Remove unused snd_get_playback_compression() method 2015-08-11 17:24:36 +02:00
spice_bitmap_utils.c Add missing license headers 2015-10-19 14:25:36 +02:00
spice_bitmap_utils.h server: move surface_format_to_image_type to spice_bitmap_utils 2013-08-14 12:08:04 +03:00
spice_image_cache.c worker: move image cache to display 2015-11-10 10:02:08 +00:00
spice_image_cache.h worker: move image cache to display 2015-11-10 10:02:08 +00:00
spice_timer_queue.c spice_timer_queue: fix access after free 2015-09-03 10:25:13 +01:00
spice_timer_queue.h server: spice_timer_queue 2013-04-22 16:30:54 -04:00
spice-audio.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-bitmap-utils.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
spice-bitmap-utils.h server: move bitmap related to spice-bitmap-utils 2015-11-03 16:32:26 +00:00
spice-bitmap-utils.tmpl.c server: rename _tmpl files 2015-11-26 13:33:36 +00:00
spice-char.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-core.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-experimental.h Add missing license headers 2015-10-19 14:25:36 +02:00
spice-input.h Split spice.h 2014-11-27 14:27:18 +01:00
spice-migration.h Move spice_server_get_num_clients() declaration 2014-11-27 15:03:38 +01:00
spice-qxl.h worker: avoid to use constant directly for capabilities size 2015-10-29 17:46:27 +00:00
spice-server.h Adjust to new SpiceImageCompress name 2015-07-29 17:40:48 +02:00
spice-server.syms server/red_{record, replay}.[ch]: introduce 2015-08-21 09:38:44 +01:00
spice-version.h.in build-sys: generate spice-version.h 2014-11-27 14:27:33 +01:00
spice.h Split spice.h 2014-11-27 14:27:18 +01:00
spicevmc.c spicevmc: set state of DeviceInstance to NULL 2015-11-13 12:01:26 +01:00
stat.h stat: fix stat_info_t initialization 2015-12-03 10:56:03 +00:00
stream.c display: rename detach_streams_behind 2015-12-02 12:44:46 +00:00
stream.h display: rename detach_streams_behind 2015-12-02 12:44:46 +00:00
tree.c Move some tree item functions to tree.[ch] 2015-11-17 17:22:05 +00:00
tree.h Move some tree item functions to tree.[ch] 2015-11-17 17:22:05 +00:00
utils.c worker: move dcc_add_surface_area_image 2015-11-23 13:50:44 +00:00
utils.h server: cleanups 2015-11-27 11:49:56 +00:00
zlib_encoder.c Use the spice-common logging functions 2012-03-25 19:00:00 +02:00
zlib_encoder.h applying zlib compression over glz on WAN connection 2010-06-21 15:05:37 +02:00