mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-05 14:05:45 +00:00
Object: Fix string leakages
This commit is contained in:
parent
7d5190865e
commit
c980ef4f90
|
@ -511,6 +511,7 @@ namespace GLib {
|
||||||
{
|
{
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
g_object_class_override_property (oclass, property_id, native_name);
|
g_object_class_override_property (oclass, property_id, native_name);
|
||||||
|
GLib.Marshaller.Free (native_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete ("Use OverrideProperty(oclass,property_id,name)")]
|
[Obsolete ("Use OverrideProperty(oclass,property_id,name)")]
|
||||||
|
@ -527,8 +528,15 @@ namespace GLib {
|
||||||
{
|
{
|
||||||
IntPtr gobjectclass = Marshal.ReadIntPtr (o.Handle);
|
IntPtr gobjectclass = Marshal.ReadIntPtr (o.Handle);
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
|
try
|
||||||
|
{
|
||||||
return g_object_class_find_property (gobjectclass, native_name);
|
return g_object_class_find_property (gobjectclass, native_name);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
GLib.Marshaller.Free (native_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate IntPtr d_g_object_interface_find_property(IntPtr klass, IntPtr name);
|
delegate IntPtr d_g_object_interface_find_property(IntPtr klass, IntPtr name);
|
||||||
static d_g_object_interface_find_property g_object_interface_find_property = FuncLoader.LoadFunction<d_g_object_interface_find_property>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_object_interface_find_property"));
|
static d_g_object_interface_find_property g_object_interface_find_property = FuncLoader.LoadFunction<d_g_object_interface_find_property>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_object_interface_find_property"));
|
||||||
|
@ -537,8 +545,15 @@ namespace GLib {
|
||||||
{
|
{
|
||||||
IntPtr g_iface = type.GetDefaultInterfacePtr ();
|
IntPtr g_iface = type.GetDefaultInterfacePtr ();
|
||||||
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
|
||||||
|
try
|
||||||
|
{
|
||||||
return g_object_interface_find_property (g_iface, native_name);
|
return g_object_interface_find_property (g_iface, native_name);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
GLib.Marshaller.Free (native_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||||
delegate void d_g_object_class_install_property(IntPtr klass, uint prop_id, IntPtr param_spec);
|
delegate void d_g_object_class_install_property(IntPtr klass, uint prop_id, IntPtr param_spec);
|
||||||
static d_g_object_class_install_property g_object_class_install_property = FuncLoader.LoadFunction<d_g_object_class_install_property>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_object_class_install_property"));
|
static d_g_object_class_install_property g_object_class_install_property = FuncLoader.LoadFunction<d_g_object_class_install_property>(FuncLoader.GetProcAddress(GLibrary.Load(Library.GObject), "g_object_class_install_property"));
|
||||||
|
|
Loading…
Reference in a new issue