It's a bug in Pango::Context::get_font_map(). It should get its own reference to the font map, but it doesn't. Until the bug has been fixed in pangomm, you can add a reference yourself.
auto fontMap = context->get_font_map(); 
        fontMap->reference();  // Temporary bug fix
Note that when you start using a fixed version of
        pangomm, the call to fontMap->reference() will cause a memory
        leak.
      
does the error occur if you do windows.reserve(2) before the emplace_back()s?Yes _______________________________________________