From 51cf78534c282f9aa8472b474961b76a66f6c898 Mon Sep 17 00:00:00 2001
From: Alessandro Ranellucci <aar@cpan.org>
Date: Sat, 14 Jun 2014 20:26:53 +0200
Subject: [PATCH] Stop background process when removing objects from the plater

---
 lib/Slic3r/GUI/Plater.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm
index 3f8cbc0bf..98961acdc 100644
--- a/lib/Slic3r/GUI/Plater.pm
+++ b/lib/Slic3r/GUI/Plater.pm
@@ -475,6 +475,8 @@ sub remove {
     my $self = shift;
     my ($obj_idx) = @_;
     
+    $self->stop_background_process;
+    
     # if no object index is supplied, remove the selected one
     if (!defined $obj_idx) {
         ($obj_idx, undef) = $self->selected_object;
@@ -489,11 +491,15 @@ sub remove {
     $self->select_object(undef);
     $self->update;
     $self->{canvas}->Refresh;
+    
+    $self->schedule_background_process;
 }
 
 sub reset {
     my $self = shift;
     
+    $self->stop_background_process;
+    
     @{$self->{objects}} = ();
     $self->{model}->clear_objects;
     $self->{print}->clear_objects;