Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

Commit

Permalink
Fix leak of File objects if they're not Disposed (bgo#646494)
Browse files Browse the repository at this point in the history
  • Loading branch information
gburt committed Apr 2, 2011
1 parent 017c8a5 commit 252aba6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gio/FileFactory.cs
Expand Up @@ -38,28 +38,28 @@ public class FileFactory

public static File NewForUri (string uri)
{
return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri), true) as File;
return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri), false) as File;
}

public static File NewForUri (Uri uri)
{
return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri.ToString ()), true) as File;
return GLib.FileAdapter.GetObject (g_file_new_for_uri (uri.ToString ()), false) as File;
}

[DllImport ("libgio-2.0-0.dll")]
private static extern IntPtr g_file_new_for_path (string path);

public static File NewForPath (string path)
{
return GLib.FileAdapter.GetObject (g_file_new_for_path (path), true) as File;
return GLib.FileAdapter.GetObject (g_file_new_for_path (path), false) as File;
}

[DllImport ("libgio-2.0-0.dll")]
private static extern IntPtr g_file_new_for_commandline_arg (string arg);

public static File NewFromCommandlineArg (string arg)
{
return GLib.FileAdapter.GetObject (g_file_new_for_commandline_arg (arg), true) as File;
return GLib.FileAdapter.GetObject (g_file_new_for_commandline_arg (arg), false) as File;
}
}
}

0 comments on commit 252aba6

Please sign in to comment.