summaryrefslogtreecommitdiffstats
path: root/client/display_channel.cpp
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2011-09-19 09:19:40 +0300
committerYonit Halperin <yhalperi@redhat.com>2011-11-02 11:30:30 +0200
commit3a1473760c0bb5da719e39ebe5cce02f5325904c (patch)
tree46c3e5a8aaf5a9d2a2145a457382f3234ef38492 /client/display_channel.cpp
parent00ff038cc90ef49f350a2fc033115d10b72995a7 (diff)
downloadspice-3a1473760c0bb5da719e39ebe5cce02f5325904c.tar.gz
spice-3a1473760c0bb5da719e39ebe5cce02f5325904c.tar.xz
spice-3a1473760c0bb5da719e39ebe5cce02f5325904c.zip
client: display channel - destroy all surfaces on disconnect
Fix not destroying surfaces and other data (e.g., streams) upon disconnection. (cherry picked from commit 010b22cd771b7e81363b4b6521e4265b093fcd25 branch 0.8)
Diffstat (limited to 'client/display_channel.cpp')
-rw-r--r--client/display_channel.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index f7fdbbc8..2e0613c2 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -1045,9 +1045,7 @@ void DisplayChannel::on_disconnect()
_surfaces_cache[0]->clear();
}
- if (screen()) {
- screen()->set_update_interrupt_trigger(NULL);
- }
+ clear();
AutoRef<DetachChannelsEvent> detach_channels(new DetachChannelsEvent(*this));
get_client().push_event(*detach_channels);
@@ -1056,7 +1054,6 @@ void DisplayChannel::on_disconnect()
get_client().push_event(*unlock_event);
detach_from_screen(get_client().get_application());
}
- get_client().deactivate_interval_timer(*_streams_timer);
AutoRef<SyncEvent> sync_event(new SyncEvent());
get_client().push_event(*sync_event);
(*sync_event)->wait();
@@ -1112,7 +1109,7 @@ void DisplayChannel::destroy_off_screen_surfaces()
}
}
-void DisplayChannel::on_disconnect_mig_src()
+void DisplayChannel::clear(bool destroy_primary)
{
_palette_cache.clear();
destroy_streams();
@@ -1122,7 +1119,16 @@ void DisplayChannel::on_disconnect_mig_src()
_update_mark = 0;
_next_timer_time = 0;
get_client().deactivate_interval_timer(*_streams_timer);
- destroy_off_screen_surfaces();
+ if (destroy_primary) {
+ destroy_all_surfaces();
+ } else {
+ destroy_off_screen_surfaces();
+ }
+}
+
+void DisplayChannel::on_disconnect_mig_src()
+{
+ clear(false);
// Not clrearing the primary surface till we receive a new one (or a timeout).
if (_surfaces_cache.exist(0)) {
AutoRef<MigPrimarySurfaceTimer> mig_timer(new MigPrimarySurfaceTimer());