title: Glib::Regex returns junk, but equivalent C functions work fine
body: <p>I'm trying to use the Glib::Regex, but it keeps returning junk.</p>
  <p>Here is a simplified version of the code:</p>
  <pre><code>void testGetPos(std::string fileName){
      auto regEx = Glib::Regex::create(
          &quot;^sprite_[0-9]+__x(-?[0-9]+)_y(-?[0-9]+)\\.tif$&quot;,
          Glib::REGEX_CASELESS
      )
  
      Glib::MatchInfo match;
  
      if(!regEx-&gt;match(fileName, match)){
          continue;
      }
  
      if(!match.matches()){
          continue;
      }
  
      auto posX = match.fetch(1);
      auto posY = match.fetch(2);
  
      // ... Use posX and posY
  }
  
  int main(){
      testGetPos(&quot;sprite_000__x-28_y-32.tif&quot;);
  }
  
  </code></pre>
  <p>After this has run, posX and posY are filled with junk. However, using C functions on the wrapped objects:</p>
  <pre><code>void testGetPos(std::string fileName){
      auto regEx = Glib::Regex::create(
          &quot;^sprite_[0-9]+__x(-?[0-9]+)_y(-?[0-9]+)\\.tif$&quot;,
          Glib::REGEX_CASELESS
      )
  
      GMatchInfo *match = nullptr;
      if(!g_regex_match(regEx-&gt;gobj(), fileName.c_str(), (GRegexMatchFlags)0, &amp;match)){
          if(match != nullptr){
              g_match_info_free(match);
          }
          return;
      }
  
      auto posX = g_match_info_fetch(match, 1);
      auto posY = g_match_info_fetch(match, 2);
  
      // ... Use posX and posY
  
      g_free(posX);
      g_free(posY);
      g_match_info_free(match);
  }
  
  int main(){
      testGetPos(&quot;sprite_000__x-28_y-32.tif&quot;);
  }
  </code></pre>
  <p>Works fine. Am I doing something wrong or is this broken.</p>