summaryrefslogtreecommitdiffstats
path: root/libmsi
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-12-03 17:32:55 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2012-12-06 20:30:32 +0100
commit6d135208c01e4df83bcd2f4dc900b36048116a6b (patch)
tree09879a704831b5d1c8c4b696f86c15a217086132 /libmsi
parente7f5c4c31622299638545486f8de58c3bba76cf9 (diff)
downloadmsitools-6d135208c01e4df83bcd2f4dc900b36048116a6b.tar.gz
msitools-6d135208c01e4df83bcd2f4dc900b36048116a6b.tar.xz
msitools-6d135208c01e4df83bcd2f4dc900b36048116a6b.zip
drop cached tables on commit
Diffstat (limited to 'libmsi')
-rw-r--r--libmsi/table.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libmsi/table.c b/libmsi/table.c
index bf3823a..15e4eca 100644
--- a/libmsi/table.c
+++ b/libmsi/table.c
@@ -2087,12 +2087,20 @@ unsigned table_view_create( LibmsiDatabase *db, const WCHAR *name, LibmsiView **
unsigned _libmsi_database_commit_tables( LibmsiDatabase *db, unsigned bytes_per_strref )
{
unsigned r = LIBMSI_RESULT_SUCCESS;
- LibmsiTable *table;
+ LibmsiTable *table, *table2;
+ LibmsiTable *t;
TRACE("%p\n",db);
- LIST_FOR_EACH_ENTRY( table, &db->tables, LibmsiTable, entry )
+ LIST_FOR_EACH_ENTRY_SAFE( table, table2, &db->tables, LibmsiTable, entry )
{
+ r = get_table( db, table->name, &t );
+ if( r != LIBMSI_RESULT_SUCCESS )
+ {
+ WARN("failed to load table %s (r=%08x)\n",
+ debugstr_w(table->name), r);
+ return r;
+ }
/* TODO: delete this if, replace with row_count check in save_table */
if (table->colinfo) {
r = save_table( db, table, bytes_per_strref );
@@ -2103,6 +2111,8 @@ unsigned _libmsi_database_commit_tables( LibmsiDatabase *db, unsigned bytes_per_
debugstr_w(table->name), r);
return r;
}
+ list_remove(&table->entry);
+ free_table(table);
}
return r;