Correct reference and implement close_fn (#578769)

Do proper referencing and unreferencing of
GWinHttpFileInputStream::file and
GWinHttpFileInputStream::file::vfs. Implement
GWinHttpFileInputStream::close_fn.
This commit is contained in:
Hans Breuer
2009-05-27 15:12:31 +03:00
committed by Tor Lillqvist
parent 623f99dc3d
commit 209a662c2f
2 changed files with 26 additions and 2 deletions

View File

@@ -24,6 +24,7 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <wchar.h>
@@ -60,6 +61,8 @@ g_winhttp_file_finalize (GObject *object)
g_free (file->url.lpszUrlPath);
g_free (file->url.lpszExtraInfo);
g_object_unref (file->vfs);
G_OBJECT_CLASS (g_winhttp_file_parent_class)->finalize (object);
}
@@ -96,7 +99,7 @@ _g_winhttp_file_new (GWinHttpVfs *vfs,
return NULL;
file = g_object_new (G_TYPE_WINHTTP_FILE, NULL);
file->vfs = vfs;
file->vfs = g_object_ref (vfs);
memset (&file->url, 0, sizeof (file->url));
file->url.dwStructSize = sizeof (file->url);