dimanche 17 janvier 2021

boost::locale::generator giving memory leak

The following sample code, compiled with -lboost_locale generates a bad cast exception as well as memory leak . It is the same code in the boost documentation itself. Any help?

File Name : DateTimeTest.cpp

#include <boost/locale.hpp>
#include <iostream>

int main()
{
    using namespace boost::locale;
    generator gen;
    std::locale::global(gen(""));  // Getting memory leak here (in valgrind report)
    std::cout.imbue(std::locale());
    // Setup environment
    boost::locale::date_time now;  //Getting bad cast exception here (in valgrind report)
    date_time start=now;
return 0;
}

I am using Boost version 1.59.0

Aucun commentaire:

Enregistrer un commentaire