[asterisk-commits] ivaxer: branch ivaxer/ast_storage r275025 - /team/ivaxer/ast_storage/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 9 11:02:45 CDT 2010


Author: ivaxer
Date: Fri Jul  9 11:02:41 2010
New Revision: 275025

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275025
Log:
implemented the ast_storage_fileinst_release() function

Modified:
    team/ivaxer/ast_storage/main/storage.c

Modified: team/ivaxer/ast_storage/main/storage.c
URL: http://svnview.digium.com/svn/asterisk/team/ivaxer/ast_storage/main/storage.c?view=diff&rev=275025&r1=275024&r2=275025
==============================================================================
--- team/ivaxer/ast_storage/main/storage.c (original)
+++ team/ivaxer/ast_storage/main/storage.c Fri Jul  9 11:02:41 2010
@@ -207,12 +207,25 @@
 
 	AST_RWLIST_TRAVERSE_SAFE_BEGIN(&fo->files, inst, list) {
 		AST_RWLIST_REMOVE_CURRENT(list);
-		ast_storage_close(inst);
-		ast_free(inst);
+		ast_storage_fileinst_release(inst);
 	}
 	AST_RWLIST_TRAVERSE_SAFE_END
 
 	ast_free(fo);
+}
+
+void ast_storage_fileinst_release(struct ast_storage_fileinst *fi) {
+	if (!fi) {
+		return;
+	}
+
+	if (fi->fd != -1) {
+		ast_storage_close(fi);
+	}
+	if (fi->localfile[0]) {
+		unlink(fi->localfile);
+	}
+	ast_free(fi);
 }
 
 void ast_storage_dirobject_release(struct ast_storage_dirobject *dobj) {




More information about the asterisk-commits mailing list