GNOME Bugzilla – Bug 145391
gstvalue.c: ref klasses instead of peek
Last modified: 2004-12-22 21:47:04 UTC
gstvalue.c:1314 peeks a klass instead of reffing it. this doesn't work in at least one of my testcases. Reffing instead of peeking does work. There's more peeks in gstvalue.c, I guess all of them need to be moved into a ref/unref pair, but the g_return_if_fail()s make that fairly difficult.
I'd like to see the test case first. This sounds like a deficiency in glib.
Created attachment 29236 [details] [review] Testcase + patch for gstvalue.c which makes the testcase work The provided patch includes a testcase in the testsuite. The test simply tests adding an enum-type to a GstStructure/GstCaps, to-/from-string conversions and asserts that the final result is as we entered in the beginning. It also patches gst/gstvalue.c to make the testcase work by doing s/peek/ref/ plus some more to unref as required. Without that part of the patch, the testcase fails.
Created attachment 29302 [details] [review] New patch This patch corrects: * klass retrieval for enum types (serialization/deserialization) * makes comparing of enums work * add a test to ensure that enums in caps work Good enough?
This one is applied now.