Module: wine Branch: master Commit: 39bcc662e46427d7a2f9380fa9ca4b1a9040a465 URL: http://source.winehq.org/git/wine.git/?a=commit;h=39bcc662e46427d7a2f9380fa9...
Author: James Hawkins truiken@gmail.com Date: Tue Oct 23 03:07:54 2007 -0500
msi: Don't delete the table if the table deleted itself because of a release.
---
dlls/msi/alter.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/msi/alter.c b/dlls/msi/alter.c index e0a1b91..b8d315e 100644 --- a/dlls/msi/alter.c +++ b/dlls/msi/alter.c @@ -145,13 +145,18 @@ static UINT alter_add_column(MSIALTERVIEW *av) static UINT ALTER_execute( struct tagMSIVIEW *view, MSIRECORD *record ) { MSIALTERVIEW *av = (MSIALTERVIEW*)view; + UINT ref;
TRACE("%p %p\n", av, record);
if (av->hold == 1) av->table->ops->add_ref(av->table); else if (av->hold == -1) - av->table->ops->release(av->table); + { + ref = av->table->ops->release(av->table); + if (ref == 0) + av->table = NULL; + }
if (av->colinfo) return alter_add_column(av); @@ -202,7 +207,8 @@ static UINT ALTER_delete( struct tagMSIVIEW *view ) MSIALTERVIEW *av = (MSIALTERVIEW*)view;
TRACE("%p\n", av ); - av->table->ops->delete( av->table ); + if (av->table) + av->table->ops->delete( av->table ); msi_free( av );
return ERROR_SUCCESS;