1 2 3 4 |
GError *error=NULL; gdk_pixbuf_save(pixbuf, "test.jpeg", "jpeg", &error); |
函数调用如上,问题出现在没有用可变参数,却同时也没有给可变参数赋值为NULL.
看官方文档发现了这句话:
The variable argument list should be NULL; if not empty, it should contain pairs of strings that modify the save parameters.
如果可变参数列表为空,是需要赋值为NULL的。
虽然没有赋值NULL不会报错,但是执行的时候会发生段错误,应当注意这个细节。