[darwinbuild-changes] [764] branches/PR-7593824/darwinup

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 11 08:46:57 PST 2010


Revision: 764
          http://trac.macosforge.org/projects/darwinbuild/changeset/764
Author:   wsiegrist at apple.com
Date:     2010-03-11 08:46:55 -0800 (Thu, 11 Mar 2010)
Log Message:
-----------
Add free_* API to DarwinupDatabase so Depot can free results without going through the make_* API. Fix leak using new API.

Modified Paths:
--------------
    branches/PR-7593824/darwinup/DB.cpp
    branches/PR-7593824/darwinup/DB.h
    branches/PR-7593824/darwinup/Depot.cpp

Modified: branches/PR-7593824/darwinup/DB.cpp
===================================================================
--- branches/PR-7593824/darwinup/DB.cpp	2010-03-11 16:40:02 UTC (rev 763)
+++ branches/PR-7593824/darwinup/DB.cpp	2010-03-11 16:46:55 UTC (rev 764)
@@ -332,6 +332,10 @@
 	return DB_OK;
 }
 
+int DarwinupDatabase::free_archive(uint8_t* data) {
+	return this->m_archives_table->free_result(data);
+}
+
 int DarwinupDatabase::delete_file(File* file) {
 	int res = this->del(this->m_files_table, file->serial());
 	if (res != SQLITE_OK) return DB_ERROR;
@@ -354,6 +358,9 @@
 	return DB_OK;
 }
 
+int DarwinupDatabase::free_file(uint8_t* data) {
+	return this->m_files_table->free_result(data);
+}
 
 int DarwinupDatabase::get_inactive_archive_serials(uint64_t** serials, uint32_t* count) {
 	int res = this->get_column("inactive_archive_serials",

Modified: branches/PR-7593824/darwinup/DB.h
===================================================================
--- branches/PR-7593824/darwinup/DB.h	2010-03-11 16:40:02 UTC (rev 763)
+++ branches/PR-7593824/darwinup/DB.h	2010-03-11 16:46:55 UTC (rev 764)
@@ -79,6 +79,7 @@
 	int      delete_empty_archives();
 	int      delete_archive(Archive* archive);
 	int      delete_archive(uint64_t serial);
+	int      free_archive(uint8_t* data);
 
 	// Files
 	File*    make_file(uint8_t* data);
@@ -95,6 +96,7 @@
 	int      delete_file(uint64_t serial);
 	int      delete_file(File* file);
 	int      delete_files(Archive* archive);
+	int      free_file(uint8_t* data);
 	
 
 protected:

Modified: branches/PR-7593824/darwinup/Depot.cpp
===================================================================
--- branches/PR-7593824/darwinup/Depot.cpp	2010-03-11 16:40:02 UTC (rev 763)
+++ branches/PR-7593824/darwinup/Depot.cpp	2010-03-11 16:46:55 UTC (rev 764)
@@ -1151,7 +1151,7 @@
 			
 			// check for being superseded by a root
 			res = this->m_db->get_next_file(&data, file, FILE_SUPERSEDED);
-			// XXX: need to send data to Table to free
+			this->m_db->free_file(data);
 			if (FOUND(res)) continue;
 			
 			// check for being superseded by external changes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20100311/36ec0e32/attachment.html>


More information about the darwinbuild-changes mailing list