// Author: Vadim Zeitlin, Robert Roebling
// Modified by:
// Created: 19.10.99
-// RCS-ID: $Id$
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
size_t wxHTMLDataObject::GetDataSize() const
{
- const wxScopedCharBuffer buffer(GetHTML().utf8_str());
+ // Ensure that the temporary string returned by GetHTML() is kept alive for
+ // as long as we need it here.
+ const wxString& htmlStr = GetHTML();
+ const wxScopedCharBuffer buffer(htmlStr.utf8_str());
size_t size = buffer.length();
return false;
// Windows and Mac always use UTF-8, and docs suggest GTK does as well.
- const wxScopedCharBuffer html(GetHTML().utf8_str());
+ const wxString& htmlStr = GetHTML();
+ const wxScopedCharBuffer html(htmlStr.utf8_str());
if ( !html )
return false;