forked from cory/tildefriends
		
	Fix some memory leaks I just introduced.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4173 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		@@ -2331,6 +2331,7 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
 | 
			
		||||
	{
 | 
			
		||||
		sqlite3_close(ssb->db_readers[i]);
 | 
			
		||||
	}
 | 
			
		||||
	tf_free(ssb->db_readers);
 | 
			
		||||
	uv_mutex_destroy(&ssb->db_readers_lock);
 | 
			
		||||
	tf_free((void*)ssb->db_path);
 | 
			
		||||
	tf_free(ssb);
 | 
			
		||||
 
 | 
			
		||||
@@ -516,6 +516,8 @@ static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status)
 | 
			
		||||
	tf_util_report_error(context, result);
 | 
			
		||||
	JS_FreeValue(context, sql_work->promise[0]);
 | 
			
		||||
	JS_FreeValue(context, sql_work->promise[1]);
 | 
			
		||||
	JS_FreeValue(context, sql_work->callback);
 | 
			
		||||
	JS_FreeCString(context, sql_work->query);
 | 
			
		||||
 | 
			
		||||
	tf_free(sql_work);
 | 
			
		||||
}
 | 
			
		||||
@@ -585,7 +587,9 @@ static JSValue _tf_ssb_sqlAsync(JSContext* context, JSValueConst this_val, int a
 | 
			
		||||
			tf_util_report_error(context, result);
 | 
			
		||||
			JS_FreeValue(context, work->promise[0]);
 | 
			
		||||
			JS_FreeValue(context, work->promise[1]);
 | 
			
		||||
			JS_FreeValue(context, work->callback);
 | 
			
		||||
			JS_FreeValue(context, error);
 | 
			
		||||
			JS_FreeCString(context, query);
 | 
			
		||||
			tf_free(work->binds);
 | 
			
		||||
			tf_free(work);
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user