nusb/cam: don't videoclose() when open failed
The fsdestroyfid() is called regardless if the open succeeded or failed. This causes erroneous videoclose() when opening the frame or video file while the camera is active.
This commit is contained in:
parent
fc36bf0711
commit
e8111e517d
|
@ -284,6 +284,8 @@ fsdestroyfid(Fid *fid)
|
|||
{
|
||||
ReadState *rs;
|
||||
|
||||
if(fid->omode == -1)
|
||||
return;
|
||||
rs = fid->aux;
|
||||
if(rs != nil){
|
||||
free(rs->buf);
|
||||
|
|
Loading…
Reference in a new issue