Alistair Leslie-Hughes : msado15: Correct field reference value.
Alexandre Julliard
julliard at winehq.org
Mon Jun 7 16:30:35 CDT 2021
Module: wine
Branch: master
Commit: 4522c54a131a0eebbe2b70b6ae1cd72bf6e6e62d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4522c54a131a0eebbe2b70b6ae1cd72bf6e6e62d
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Mon Jun 7 16:28:57 2021 +1000
msado15: Correct field reference value.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msado15/recordset.c | 9 +++++++++
dlls/msado15/tests/msado15.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c
index 2b32dc6cf94..8d7619d9161 100644
--- a/dlls/msado15/recordset.c
+++ b/dlls/msado15/recordset.c
@@ -594,6 +594,7 @@ static HRESULT Field_create( const WCHAR *name, LONG index, struct recordset *re
field->Field_iface.lpVtbl = &field_vtbl;
field->ISupportErrorInfo_iface.lpVtbl = &field_supporterrorinfo_vtbl;
field->Properties_iface.lpVtbl = &field_properties_vtbl;
+ field->refs = 1;
if (!(field->name = strdupW( name )))
{
heap_free( field );
@@ -998,6 +999,7 @@ static ULONG WINAPI recordset_AddRef( _Recordset *iface )
static void close_recordset( struct recordset *recordset )
{
ULONG row, col, col_count;
+ ULONG i;
if ( recordset->row_set ) IRowset_Release( recordset->row_set );
recordset->row_set = NULL;
@@ -1005,6 +1007,13 @@ static void close_recordset( struct recordset *recordset )
if (!recordset->fields) return;
col_count = get_column_count( recordset );
+ for (i = 0; i < col_count; i++)
+ {
+ struct field *field = impl_from_Field( recordset->fields->field[i] );
+ field->recordset = NULL;
+ Field_Release(&field->Field_iface);
+ }
+ recordset->fields->count = 0;
Fields_Release( &recordset->fields->Fields_iface );
recordset->fields = NULL;
diff --git a/dlls/msado15/tests/msado15.c b/dlls/msado15/tests/msado15.c
index 16faefef550..97a578b0618 100644
--- a/dlls/msado15/tests/msado15.c
+++ b/dlls/msado15/tests/msado15.c
@@ -273,7 +273,7 @@ static void test_Recordset(void)
count = -1;
hr = Fields_get_Count( fields, &count );
- todo_wine ok( !count, "got %d\n", count );
+ ok( !count, "got %d\n", count );
hr = Field_get_Name(field, &name);
todo_wine ok( hr == MAKE_ADO_HRESULT( adErrObjectNotSet ), "got %08x\n", hr );
More information about the wine-cvs
mailing list