Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit d51d402

Browse files
committed
Properly close the video file if rendering is aborted
1 parent 99da72c commit d51d402

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/js/flightlog_video_renderer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
133133
that.emit("complete", success, frameCount);
134134
}
135135

136-
function finishRender() {
136+
function finishRender(success) {
137137
var
138138
complete;
139139

@@ -146,7 +146,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
146146
}
147147

148148
complete.then(function() {
149-
notifyCompletion(true, frameIndex);
149+
notifyCompletion(success, frameIndex);
150150
});
151151
}
152152

@@ -162,7 +162,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
162162
framesToRender = Math.min(workChunkSize, frameCount - frameIndex);
163163

164164
if (cancel) {
165-
notifyCompletion(false);
165+
finishRender(false);
166166
return;
167167
}
168168

@@ -171,7 +171,7 @@ function FlightLogVideoRenderer(flightLog, logParameters, videoOptions) {
171171
that.emit("progress", frameIndex, frameCount, that.getWrittenSize());
172172

173173
if (frameIndex >= frameCount) {
174-
finishRender();
174+
finishRender(true);
175175
} else {
176176
setTimeout(renderChunk, 0);
177177
}

0 commit comments

Comments
 (0)