~darkxst/ubuntu/raring/cogl/lp1163025

« back to all changes in this revision

Viewing changes to cogl/cogl-object.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-03-13 19:11:11 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120313191111-3hgk529qkh9m6uk2
Tags: 1.9.8-0ubuntu1
* New upstream release (LP: #941617)
* Updated symbols & library name for soname update
* debian/control.in: Bump minimum glib to 2.28
* debian/patches/02_disable_armv5t_specific_optimization.patch: Disabled

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <glib.h>
31
31
#include <string.h>
32
32
 
 
33
#include "cogl-util.h"
33
34
#include "cogl-types.h"
34
35
#include "cogl-object-private.h"
35
36
 
38
39
{
39
40
  CoglObject *obj = object;
40
41
 
41
 
  g_return_val_if_fail (object != NULL, NULL);
 
42
  _COGL_RETURN_VAL_IF_FAIL (object != NULL, NULL);
42
43
 
43
44
  obj->ref_count++;
44
45
  return object;
51
52
}
52
53
 
53
54
void
54
 
cogl_object_unref (void *object)
 
55
_cogl_object_default_unref (void *object)
55
56
{
56
57
  CoglObject *obj = object;
57
58
 
58
 
  g_return_if_fail (object != NULL);
59
 
  g_return_if_fail (obj->ref_count > 0);
 
59
  _COGL_RETURN_IF_FAIL (object != NULL);
 
60
  _COGL_RETURN_IF_FAIL (obj->ref_count > 0);
60
61
 
61
62
  if (--obj->ref_count < 1)
62
63
    {
97
98
}
98
99
 
99
100
void
 
101
cogl_object_unref (void *obj)
 
102
{
 
103
  void (* unref_func) (void *) = ((CoglObject *) obj)->klass->virt_unref;
 
104
  unref_func (obj);
 
105
}
 
106
 
 
107
void
100
108
cogl_handle_unref (CoglHandle handle)
101
109
{
102
110
  cogl_object_unref (handle);
182
190
    }
183
191
  else
184
192
    {
 
193
      /* NB: Setting a value of NULL is documented to delete the
 
194
       * corresponding entry so we can return immediately in this
 
195
       * case. */
 
196
      if (user_data == NULL)
 
197
        return;
 
198
 
185
199
      if (G_LIKELY (object->n_user_data_entries <
186
200
                    COGL_OBJECT_N_PRE_ALLOCATED_USER_DATA_ENTRIES))
187
201
        entry = &object->user_data_entry[object->n_user_data_entries++];