2005-08-27 Peter Williams <peter@newton.cx>

* gnome/Program.custom: Use a GLib.Argv in PersistentData to store
	a handle to argv, so that the unmanaged strings aren't freed out
	from under popt. This allows the popt context to actually be used.


svn path=/trunk/gtk-sharp/; revision=48983
This commit is contained in:
Peter Williams 2005-08-27 19:57:55 +00:00
parent a12a4b48f0
commit 675b915e36
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2005-08-27 Peter Williams <peter@newton.cx>
* gnome/Program.custom: Use a GLib.Argv in PersistentData to store
a handle to argv, so that the unmanaged strings aren't freed out
from under popt. This allows the popt context to actually be used.
2005-08-26 John Luke <john.luke@gmail.com> 2005-08-26 John Luke <john.luke@gmail.com>
* glib/Signal.cs: deal with obj.Handle == IntPtr.Zero * glib/Signal.cs: deal with obj.Handle == IntPtr.Zero

View file

@ -34,7 +34,7 @@ struct PropertyArg {
[DllImport("gnomesharpglue-2")] [DllImport("gnomesharpglue-2")]
static extern System.IntPtr static extern System.IntPtr
gtksharp_gnome_program_init (string app_id, string app_version, IntPtr module, int argc, string[] argv, int nargs, PropertyArg[] args); gtksharp_gnome_program_init (string app_id, string app_version, IntPtr module, int argc, IntPtr argv, int nargs, PropertyArg[] args);
public Program (string app_id, string app_version, ModuleInfo module, string[] argv, params object[] props) : base (IntPtr.Zero) public Program (string app_id, string app_version, ModuleInfo module, string[] argv, params object[] props) : base (IntPtr.Zero)
{ {
@ -68,7 +68,10 @@ public Program (string app_id, string app_version, ModuleInfo module, string[] a
/* FIXME: Is there a way to access this in .NET? */ /* FIXME: Is there a way to access this in .NET? */
new_argv[0] = app_id; new_argv[0] = app_id;
Array.Copy (argv, 0, new_argv, 1, argv.Length); Array.Copy (argv, 0, new_argv, 1, argv.Length);
Raw = gtksharp_gnome_program_init (app_id, app_version, module.Handle, new_argv.Length, new_argv, nargs, args);
GLib.Argv gargv = new GLib.Argv (new_argv, false);
Raw = gtksharp_gnome_program_init (app_id, app_version, module.Handle, new_argv.Length, gargv.Handle, nargs, args);
PersistentData["glib_argv"] = gargv;
// //
// Dynamically reset the signal handlers, because Gnome overwrites them // Dynamically reset the signal handlers, because Gnome overwrites them