diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-05-29 22:12:12 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-05-29 22:12:12 +0200 |
commit | 9fa9c1b7d88f15432399fb9a77ae476104e1a80b (patch) | |
tree | 22f291537f0ab312de1a3c9c306b39d00f938e62 | |
parent | 91945e2131a2e1df3d033f8000a1d5700acf8683 (diff) |
Throw an exception if an element can't be instantiated in element bindings
-rw-r--r-- | elementgen/elementgen.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/elementgen/elementgen.cs b/elementgen/elementgen.cs index 8d92729..cdc9565 100644 --- a/elementgen/elementgen.cs +++ b/elementgen/elementgen.cs @@ -281,6 +281,8 @@ public class ElementGen { writer.WriteLine ("\t\t\tRaw = gst_element_factory_make (native_element, native_name);"); writer.WriteLine ("\t\t\tGLib.Marshaller.Free (native_name);"); writer.WriteLine ("\t\t\tGLib.Marshaller.Free (native_element);"); + writer.WriteLine ("\t\t\tif (Raw == IntPtr.Zero)"); + writer.WriteLine ("\t\t\t\tthrow new Exception (\"Failed to instantiate element \\\"" + ei.name + "\\\"\");"); writer.WriteLine ("\t\t}\n"); writer.WriteLine ("\t\tpublic " + class_name + " () : this ((string) null) { }\n"); |