Throw an exception if an element can't be instantiated in element bindings

This commit is contained in:
Sebastian Dröge 2009-05-29 22:12:12 +02:00
parent 91945e2131
commit 9fa9c1b7d8

View file

@ -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");