X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fcross_windows.cc;h=f7638083656c2731411075144fbd10f8b72f9a2b;hb=809bcfd85fad2ef7d4131c054be4cccd5bcc9d05;hp=a7e7bdd555255830550915a00c4524048e03cc94;hpb=9a9ce1aec97db89b00bc216edf7cee5f3d48670e;p=dcpomatic.git diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index a7e7bdd55..f76380836 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -353,10 +353,9 @@ static string wchar_to_utf8 (wchar_t const * s) { int const length = (wcslen(s) + 1) * 2; - char* utf8 = new char[length]; - WideCharToMultiByte (CP_UTF8, 0, s, -1, utf8, length, 0, 0); - string u (utf8); - delete[] utf8; + std::vector utf8(length); + WideCharToMultiByte (CP_UTF8, 0, s, -1, utf8.data(), length, 0, 0); + string u (utf8.data()); return u; }