title: C++ GeoClue g_object_unref: assertion 'G_IS_OBJECT (object)' failed
body: <p>So I recently tried to try out GeoClue for one of my Raspberry Pi projects, but I got stuck on using gclue-simple(). Running gclue_simple_new seemed to be fine, but when I was trying to pick up the pointer with gclue_simple_new_finish(), the program gives me a runtime error:</p>
  <pre><code>(process:37607): GLib-GIO-CRITICAL **: 16:26:33.873: g_async_result_get_source_object: assertion 'G_IS_ASYNC_RESULT (res)' failed
  
  (process:37607): GLib-GIO-CRITICAL **: 16:26:33.873: g_async_initable_init_finish: assertion 'G_IS_ASYNC_INITABLE (initable)' failed
  
  (process:37607): GLib-GObject-CRITICAL **: 16:26:33.873: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
  </code></pre>
  <p>The code for the program is here:</p>
  <pre><code>#include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  
  #include &lt;gclue-simple.h&gt;
  
  void geoclue_callback (GObject* srcObj, GAsyncResult* result, void* userData); 
  
  int main(){
      std::cout &lt;&lt; &quot;Program started.&quot; &lt;&lt; std::endl; 
      
      const char* DESKTOP_ID = &quot;desktop1&quot;; 
      GClueAccuracyLevel accuracy = GCLUE_ACCURACY_LEVEL_CITY; 
      GCancellable* cancellablePtr = NULL; 
      GAsyncReadyCallback callback = geoclue_callback; 
      //gpointer is like void pointer. 
      gpointer usrDataPtr; 
  
      std::cout &lt;&lt; &quot;Variables declared.&quot; &lt;&lt; std::endl; 
  
      gclue_simple_new(
          DESKTOP_ID, 
          accuracy, 
          cancellablePtr, 
          callback, 
          usrDataPtr
      ); 
  
      std::cout &lt;&lt; &quot;geoclue service started.&quot; &lt;&lt; std::endl; 
  
      GClueSimple* gclueServicePtr; 
      GAsyncResult* rstPtr; 
      GError** errsPtr; 
      //This part here causes runtime error. 
      gclueServicePtr = gclue_simple_new_finish(rstPtr, errsPtr); 
  
  }
  
  void geoclue_callback (GObject* srcObj, GAsyncResult* result, void* userData) { 
      //Callback function for when Geoclue comes up with something
      std::cout &lt;&lt; &quot;Results Ready.&quot; &lt;&lt; std::endl; 
  }
  </code></pre>
  <p>I've only just gotten into geoclue and I have no previous experience with anything related to gtk or the GNOME project, so I'm probably missing something obvious.</p>
  <p>Thanks!</p>