Skip to content

Commit

Permalink
CB-9413 Close RandomAccessStream once copied
Browse files Browse the repository at this point in the history
  • Loading branch information
muratsu committed Jul 27, 2015
1 parent eeb5880 commit 110b3b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/windows/CameraProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ function takePictureFromCameraWP(successCallback, errorCallback, args) {
return tempCapturedFile.openAsync(Windows.Storage.FileAccessMode.readWrite);
})
.then(function(fileStream) {
return Windows.Storage.Streams.RandomAccessStream.copyAsync(finalStream, fileStream);
return Windows.Storage.Streams.RandomAccessStream.copyAndCloseAsync(finalStream, fileStream);
})
.done(function() {
photoStream.close();
Expand Down Expand Up @@ -718,7 +718,7 @@ function savePhoto(picture, options, successCallback, errorCallback) {
resizeImageBase64(successCallback, errorCallback, picture, options.targetWidth, options.targetHeight);
} else {
fileIO.readBufferAsync(picture).done(function(buffer) {
var strBase64 =encodeToBase64String(buffer);
var strBase64 = encodeToBase64String(buffer);
picture.deleteAsync().done(function() {
successCallback(strBase64);
}, function(err) {
Expand Down

0 comments on commit 110b3b3

Please sign in to comment.