[farsight2/master] Allocate FsCandidate usnig GSlice

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:22:31 PST 2008


---
 gst-libs/gst/farsight/fs-candidate.c |    6 +++---
 python/pyfarsight.override           |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-candidate.c b/gst-libs/gst/farsight/fs-candidate.c
index 282119f..279320d 100644
--- a/gst-libs/gst/farsight/fs-candidate.c
+++ b/gst-libs/gst/farsight/fs-candidate.c
@@ -84,7 +84,7 @@ fs_candidate_destroy (FsCandidate * cand)
   g_free ((gchar *) cand->username);
   g_free ((gchar *) cand->password);
 
-  g_free (cand);
+  g_slice_free (FsCandidate, cand);
 }
 
 /**
@@ -98,7 +98,7 @@ fs_candidate_destroy (FsCandidate * cand)
 FsCandidate *
 fs_candidate_copy (const FsCandidate * cand)
 {
-  FsCandidate *copy = g_new0 (FsCandidate, 1);
+  FsCandidate *copy = g_slice_new0 (FsCandidate);
 
   copy->component_id = cand->component_id;
   copy->port = cand->port;
@@ -186,7 +186,7 @@ fs_candidate_new (
     const gchar *ip,
     guint port)
 {
-  FsCandidate *candidate = g_new0 (FsCandidate, 1);
+  FsCandidate *candidate = g_slice_new0 (FsCandidate);
 
   candidate->foundation = g_strdup (foundation);
   candidate->component_id = component_id;
diff --git a/python/pyfarsight.override b/python/pyfarsight.override
index 10d8a10..120f172 100644
--- a/python/pyfarsight.override
+++ b/python/pyfarsight.override
@@ -468,7 +468,7 @@ _wrap_fs_candidate_new(PyGBoxed *self)
 {
   self->gtype = FS_TYPE_CANDIDATE;
   self->free_on_dealloc = FALSE;
-  self->boxed = g_new0 (FsCandidate, 1);
+  self->boxed = g_slice_new0 (FsCandidate);
 
   if (!self->boxed) {
     PyErr_SetString(PyExc_RuntimeError, "could not create FsCodec object");
-- 
1.5.6.5




More information about the farsight-commits mailing list