~ubuntu-branches/ubuntu/wily/grilo/wily

« back to all changes in this revision

Viewing changes to libs/net/grl-net-mock.c

  • Committer: Package Import Robot
  • Author(s): Alberto Garcia
  • Date: 2014-02-15 18:06:20 UTC
  • mfrom: (1.2.3)
  • Revision ID: package-import@ubuntu.com-20140215180620-m8p91wg7zordxcl8
Tags: 0.2.8-1
* New upstream release (Closes: #739025, #739028).
* debian/control:
  - Update Standards-Version to 3.9.5 (no changes).
  - Bump build dependency on libglib2.0-dev to 2.32.
  - Add build dependency on libtotem-plparser-dev.
  - Build depend on the generic valac package, there's no need for any
    specific version of Vala.
* Don't require libvala, it's not used by Grilo at all.
  - debian/patches/drop-libvala.patch: remove check in configure.ac
  - debian/control: remove build dependency.
* debian/libgrilo-0.2-1.symbols: update.
* debian/copyright: update copyright years.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
static GRegex *ignored_parameters = NULL;
41
41
static char *base_path = NULL;
42
42
static gboolean enable_mocking = FALSE;
 
43
static gint refcount = 0;
43
44
 
44
45
gboolean
45
46
is_mocked (void)
164
165
 
165
166
void init_mock_requester (GrlNetWc *self)
166
167
{
 
168
  g_atomic_int_inc (&refcount);
 
169
 
 
170
  if (refcount > 1) {
 
171
    return;
 
172
  }
 
173
 
167
174
  char *config_filename = g_strdup (g_getenv (GRL_NET_MOCKED_VAR));
168
175
  enable_mocking = FALSE;
169
176
  int i;
254
261
 
255
262
void finalize_mock_requester (GrlNetWc *self)
256
263
{
257
 
  if (config) {
258
 
    g_key_file_unref (config);
259
 
  }
260
 
 
261
 
  if (base_path) {
262
 
    g_free (base_path);
263
 
  }
264
 
 
265
 
  if (ignored_parameters) {
266
 
    g_regex_unref (ignored_parameters);
 
264
  if (refcount == 0) {
 
265
    return;
 
266
  }
 
267
 
 
268
  if (g_atomic_int_dec_and_test (&refcount)) {
 
269
    if (config) {
 
270
      g_key_file_unref (config);
 
271
    }
 
272
 
 
273
    if (base_path) {
 
274
      g_free (base_path);
 
275
    }
 
276
 
 
277
    if (ignored_parameters) {
 
278
      g_regex_unref (ignored_parameters);
 
279
    }
267
280
  }
268
281
}
269
282