glib

Getting memory leaks in Glib/GDBus code?

给你一囗甜甜゛ 提交于 2019-12-13 06:59:48
问题 I'm using GDBus (via Glib) and I have code like: method_call_message = g_dbus_message_new_method_call(owner, OBJECT_PATH, INTERFACE_NAME, "get_snmpv2_mib"); GVariant *gv = g_variant_new("(sissi)", ip, port, mib, variable, instance); g_dbus_message_set_body(method_call_message, gv); I assume method_call_message is now a container for gv . Before exiting I call: g_object_unref(method_call_message); I assume this will then schedule BOTH method_call_message and gv for GC? When is GC done? I

meld - GLib-GIO-ERROR**: No GSettings schemas are installed on the system

不羁的心 提交于 2019-12-13 01:13:29
问题 I have installed meld 3.14.2, at last (on NFS share in Redhat 6.3 server), after nearly 40 hours of efforts , installing each and every dependency and at last seems to be successful. But one finale error needs to be solved: (meld:20703): GLib-GIO-ERROR **: No GSettings schemas are installed on the system Trace/breakpoint trap (core dumped) There was answer here: GLib-GIO-ERROR**: No GSettings schemas are installed on the system I am not aware of these jargons before. So, please explain in

How to do OptionContext parsing on an instance?

Deadly 提交于 2019-12-13 01:05:31
问题 I'm trying to get options parsing using OptionContext to work. My code so far: public class Options : GLib.Object { public string option_output = ""; public Options () { } public void parse (string args[]) throws OptionError { // string option_output; const OptionEntry[] options = { { "output", 'o', 0, OptionArg.FILENAME, ref option_output, "file name for encoded output (required);", "FILE" }, {null} }; var opt_context = new OptionContext ("- vpng2theora"); opt_context.set_help_enabled (true)

trying to execute shell command by g_spawn_async and read the output

…衆ロ難τιáo~ 提交于 2019-12-13 00:46:08
问题 I was trying to execute a shell command (ls /home) and trying to read the output where actually is the problem with this program? Here is the program. #include <stdio.h> #include <glib.h> #include <stdlib.h> #include <signal.h> typedef struct{ int std_in; int std_out; int std_err; }child_fds; gboolean cb_stdout(GIOChannel* channel, GIOCondition condition, gpointer data){ if(condition & G_IO_ERR ){ return TRUE; } if(condition & G_IO_HUP ){ return FALSE; } gsize actually_read; gchar* shell_out

Garbage collection with glib?

北城以北 提交于 2019-12-12 10:47:53
问题 I would like to interface an garbage collected language (specifically, it's using the venerable Boehm libgc) to the glib family of APIs. glib and gobject use reference counting internally to manage object lifetime. The normal way to wrap these is to use a garbage collected peer object which holds a reference to the glib object, and which drops the reference when the peer gets finalised; this means that the glib object is kept alive while the application is using the peer. I've done this

How to use glib on iphone? [closed]

*爱你&永不变心* 提交于 2019-12-12 09:05:19
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I'm working on a project these days. A third party library was included in my project, and the library is based on glib. That really make me crazy. Can you everybody tell me what should I do? How to use glib on an iphone application? Dose apple allow us use glib for iphone

Properly include GLib headers with autotools

白昼怎懂夜的黑 提交于 2019-12-12 04:53:19
问题 In my normal dev environment (ubuntu), I don't have any issues linking against GLib-2.0, however when I attempt to build on fresh install of Debian Squeeze, I run into errors linking GLib. configure.ac: ... AC_PROG_CC AM_PROG_CC_C_O CFLAGS="$CFLAGS -Wall -W -Wno-unused-parameter -std=c99 -pedantic" PKG_CHECK_MODULES(MYAPP, [glib-2.0 >= 2.3.0 gthread-2.0]) LIBS="$LIBS $MYAPP_LIBS" AC_CONFIG_FILES([Makefile src/Makefile]) AC_OUTPUT Autotools appears to pass the correct options to gcc: -I/usr

C calling function on contents of linked list

痴心易碎 提交于 2019-12-12 04:35:55
问题 I am using GLib to manage a linked list. I am declaring 2 structs and the placing them in a linked list as follows. Asteroid asteroid = {0,0,50,50,50} Asteroid asteroids = {0,0,200,200,50}; GList *asteroidList = NULL; asteroidList = g_list_append(asteroidList, &asteroid); asteroidList = g_list_append(asteroidList, &asteroids); Then i use the following function to traverse the list and calla function that draws the struct to the screen as a circle as follows void drawAsteroids(){ GList *list =

How to override handle_message in GstBin?

风格不统一 提交于 2019-12-12 04:21:21
问题 Trying to make a subclass: mybin.h: #pragma once #include <gst/gstbin.h> G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(MyBin, my_bin, MY, BIN, GstBin) struct _MyBinClass { GstBinClass parent_class; }; GstElement* my_bin_new(const gchar *name); G_END_DECLS mybin.c: #include "mybin.h" G_DEFINE_TYPE(MyBin, my_bin, GST_TYPE_BIN) static void my_bin_init(MyBin *bin) { } static void my_bin_class_init(MyBinClass *class) { // virtual function overrides go here } GstElement* my_bin_new(const gchar *name) { //

gstreamer sample documentation code not running

一曲冷凌霜 提交于 2019-12-12 03:05:14
问题 Trying to compile and run a sample appsrc code after having successfully executed several tutorials. This is a documentation code, supposed it to run but ... The command used to compile gcc appGuideAppSrc.c -o appGuide `pkg-config --cflags --libs gstreamer-0.10 gstreamer-app-0.10` Got the following error after appGuideAppSrc.c: In function ‘cb_need_data’: appGuideAppSrc.c:14:8: warning: assignment makes pointer from integer without a cast [enabled by default] appGuideAppSrc.c:18:25: error: