From d46d24332f3a16fa736def96a717e1648441161a Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Sat, 23 Oct 2010 12:40:07 +0000 Subject: fix leak-file-handles. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28330 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/wav2wv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/plugins/wav2wv.c') diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c index e2db398ef7..cd27c92699 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; } -- cgit v1.2.3