summaryrefslogtreecommitdiff
path: root/apps/plugins/wav2wv.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2010-10-23 12:40:07 +0000
committerTeruaki Kawashima <teru@rockbox.org>2010-10-23 12:40:07 +0000
commitd46d24332f3a16fa736def96a717e1648441161a (patch)
treeafc9e1e6958d32651bfcac79ceefefc689d3afb8 /apps/plugins/wav2wv.c
parent368e89e3bc88446c8fac3d5cfca266061f4e77fb (diff)
downloadrockbox-d46d24332f3a16fa736def96a717e1648441161a.zip
rockbox-d46d24332f3a16fa736def96a717e1648441161a.tar.gz
rockbox-d46d24332f3a16fa736def96a717e1648441161a.tar.bz2
rockbox-d46d24332f3a16fa736def96a717e1648441161a.tar.xz
fix leak-file-handles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28330 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/wav2wv.c')
-rw-r--r--apps/plugins/wav2wv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c
index e2db398..cd27c92 100644
--- a/apps/plugins/wav2wv.c
+++ b/apps/plugins/wav2wv.c
@@ -123,6 +123,7 @@ static int wav2wv(const char *infile)
if (rb->read (in_fd, &raw_header, sizeof (raw_header)) != sizeof (raw_header)) {
rb->splash(HZ*2, "could not read file!");
+ rb->close (in_fd);
return true;
}
@@ -135,6 +136,7 @@ static int wav2wv(const char *infile)
rb->strncmp (native_header.data_ckID, "data", 4) ||
native_header.FormatTag != 1 || native_header.BitsPerSample != 16) {
rb->splash(HZ*2, "incompatible wav file!");
+ rb->close (in_fd);
return true;
}
@@ -266,6 +268,7 @@ static int wav2wv(const char *infile)
else
rb->splash(HZ*3, "operation successful");
+ rb->reload_directory();
return error;
}
@@ -290,6 +293,5 @@ enum plugin_status plugin_start(const void *parameter)
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
rb->cpu_boost(false);
#endif
- /* Return PLUGIN_USB_CONNECTED to force a file-tree refresh */
- return PLUGIN_USB_CONNECTED;
+ return PLUGIN_OK;
}