change thread join strategy, fix a few leaks, fix a few bugs
[goodguy/history.git] / cinelerra-5.1 / cinelerra / commercials.C
index e74275b5db6f3c80a01605773fd81013f7f584d6..2485f263fca69c0f7b96c91a36a74b02647bc1cf 100644 (file)
@@ -533,7 +533,7 @@ cut_edit(Track *track, Edit *edit, int64_t clip_start, int64_t clip_end)
                }
        }
        // cut edit
-       Edit *next_edit = track->edits->split_edit(edit, cut_start);
+       Edit *next_edit = edit->edits->split_edit(cut_start);
        int64_t cut_length = cut_end - cut_start;
        next_edit->length -= cut_length;
        next_edit->startsource += cut_length;
@@ -787,8 +787,8 @@ stop()
        if( running() ) {
                if( gui ) gui->set_done(1);
                cancel();
-               join();
        }
+       join();
 }
 
 void ScanStatus::
@@ -856,8 +856,8 @@ stop()
                done = 1;
                input_lock->unlock();
                cancel();
-               join();
        }
+       join();
        if( commercials && !commercials->remove_user() )
                commercials = 0;
 }