Signed-off-by: Sven Baars sven.wine@gmail.com --- dlls/taskschd/tests/scheduler.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/taskschd/tests/scheduler.c b/dlls/taskschd/tests/scheduler.c index 5fc3aab595..60546c30b2 100644 --- a/dlls/taskschd/tests/scheduler.c +++ b/dlls/taskschd/tests/scheduler.c @@ -153,11 +153,13 @@ static void test_GetFolder(void) hr = ITaskService_GetFolder(service, slash, &folder); todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr); + if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder); todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr); + if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, bslash, &folder); ok(hr == S_OK, "GetFolder error %#x\n", hr); @@ -544,6 +546,7 @@ static void test_FolderCollection(void) ok(!lstrcmpW(bstr, Folder1), "expected Folder1, got %s\n", wine_dbgstr_w(bstr)); else ok(!lstrcmpW(bstr, Folder2), "expected Folder2, got %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr);
ITaskFolder_Release(subfolder); } @@ -571,6 +574,7 @@ static void test_FolderCollection(void)
hr = IUnknown_QueryInterface(unknown, &IID_IUnknown, (void **)&enumvar); ok(hr == S_OK, "QueryInterface error %#x\n", hr); + IUnknown_Release(unknown);
hr = IEnumVARIANT_Skip(enumvar, 0); ok(hr == S_OK, "expected S_OK, got %#x\n", hr); @@ -605,6 +609,7 @@ static void test_FolderCollection(void) ok(!lstrcmpW(bstr, Folder1), "expected Folder1, got %s\n", wine_dbgstr_w(bstr)); else ok(!lstrcmpW(bstr, Folder2), "expected Folder2, got %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); IDispatch_Release(V_DISPATCH(&var[0]));
memset(var, 0, sizeof(var)); @@ -650,6 +655,7 @@ static void test_FolderCollection(void) ok(!lstrcmpW(bstr, Folder1), "expected Folder1, got %s\n", wine_dbgstr_w(bstr)); else ok(!lstrcmpW(bstr, Folder2), "expected Folder2, got %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr);
ITaskFolder_Release(subfolder); } @@ -1049,7 +1055,10 @@ static void test_settings_v1(ITaskDefinition *taskdef, struct settings *test, st if (!test->execution_time_limit[0]) ok(bstr == NULL, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); else + { ok(!lstrcmpW(bstr, test->execution_time_limit), "expected %s, got %s\n", wine_dbgstr_w(test->execution_time_limit), wine_dbgstr_w(bstr)); + SysFreeString(bstr); + }
hr = ITaskSettings_get_Enabled(set, &vbool); ok(hr == S_OK, "expected S_OK, got %#x\n", hr);
Sven Baars sven.wine@gmail.com wrote:
hr = ITaskService_GetFolder(service, slash, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr);
- if (hr == S_OK) ITaskFolder_Release(folder);
Fixing Wine code and removing the todo_wine would be a more appropriate fix.
On 15-01-19 15:20, Dmitry Timoshkov wrote:
Sven Baars sven.wine@gmail.com wrote:
hr = ITaskService_GetFolder(service, slash, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr);
- if (hr == S_OK) ITaskFolder_Release(folder);
Fixing Wine code and removing the todo_wine would be a more appropriate fix.
Of course, but at the moment I'm just trying to fix all memory leaks that are present in the tests during the code freeze. That way it is easier to find and fix actual memory leaks in wine itself after the code freeze. I already have some patches lined up for that as well.
Best, Sven
Sven Baars sven.wine@gmail.com wrote:
hr = ITaskService_GetFolder(service, slash, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr);
- if (hr == S_OK) ITaskFolder_Release(folder);
Fixing Wine code and removing the todo_wine would be a more appropriate fix.
Of course, but at the moment I'm just trying to fix all memory leaks that are present in the tests during the code freeze. That way it is easier to find and fix actual memory leaks in wine itself after the code freeze. I already have some patches lined up for that as well.
The problem is that this kind of fixes would have to be be removed later, so it's better to not introduce them in the first place.
On 15-01-19 15:52, Dmitry Timoshkov wrote:
Sven Baars sven.wine@gmail.com wrote:
hr = ITaskService_GetFolder(service, slash, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr);
- if (hr == S_OK) ITaskFolder_Release(folder);
Fixing Wine code and removing the todo_wine would be a more appropriate fix.
Of course, but at the moment I'm just trying to fix all memory leaks that are present in the tests during the code freeze. That way it is easier to find and fix actual memory leaks in wine itself after the code freeze. I already have some patches lined up for that as well.
The problem is that this kind of fixes would have to be be removed later, so it's better to not introduce them in the first place.
But the effort of removing that line is a lot smaller than the effort of investigating a trace with a lot of question marks and wrong line numbers, which is what this leak generates:
==32665== 12 bytes in 1 blocks are definitely lost in loss record 105 of 665 ==32665== at 0x7BC507B3: RtlAllocateHeap (heap.c:260) ==32665== by 0x5FBAD8F: heap_alloc (heap.h:29) ==32665== by 0x5FBAD8F: TaskFolder_create (???:0) ==32665== by 0x5FC32E5: TaskService_GetFolder (task.c:3757) ==32665== by 0x4CE92F5: ITaskService_GetFolder (taskschd.h:624) ==32665== by 0x4CE92F5: test_GetFolder (???:0)
Sven Baars sven.wine@gmail.com wrote:
hr = ITaskService_GetFolder(service, slash, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME), "expected ERROR_INVALID_NAME, got %#x\n", hr);
if (hr == S_OK) ITaskFolder_Release(folder);
hr = ITaskService_GetFolder(service, dot, &folder);
todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) /* win7 */, "expected ERROR_INVALID_NAME, got %#x\n", hr);
- if (hr == S_OK) ITaskFolder_Release(folder);
Fixing Wine code and removing the todo_wine would be a more appropriate fix.
Of course, but at the moment I'm just trying to fix all memory leaks that are present in the tests during the code freeze. That way it is easier to find and fix actual memory leaks in wine itself after the code freeze. I already have some patches lined up for that as well.
The problem is that this kind of fixes would have to be be removed later, so it's better to not introduce them in the first place.
But the effort of removing that line is a lot smaller than the effort of investigating a trace with a lot of question marks and wrong line numbers, which is what this leak generates:
I'd argue that leaving the leaks in place should be a motivation (or annoy enough) to implement missing functionality instead of silencing Valgrind.