]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix mem corruption due to string no longer being in scope
authorRobert Roebling <robert@roebling.de>
Tue, 20 May 2008 17:01:20 +0000 (17:01 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 20 May 2008 17:01:20 +0000 (17:01 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53677 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/datavgen.cpp

index f9f0346f8b7b3da324877558cefc77e5a27bb633..e1caf28c3cca6ebf821b56aaacfbdbd3c3a3676a 100644 (file)
@@ -1412,6 +1412,7 @@ void wxDataViewHeaderWindowMSW::UpdateDisplay()
         if (col->IsHidden())
             continue;      // don't add it!
 
+        wxString title( col->GetTitle() );
         HDITEM hdi;
         hdi.mask = HDI_TEXT | HDI_FORMAT | HDI_WIDTH;
         if (col->GetBitmap().IsOk())
@@ -1420,7 +1421,7 @@ void wxDataViewHeaderWindowMSW::UpdateDisplay()
            hdi.mask |= HDI_IMAGE;
            hdi.iImage = m_imageList->GetImageCount()-1;
         }
-        hdi.pszText = (wxChar *) col->GetTitle().wx_str();
+        hdi.pszText = (wxChar *) title.wx_str();
         hdi.cxy = col->GetWidth();
         hdi.cchTextMax = sizeof(hdi.pszText)/sizeof(hdi.pszText[0]);
         hdi.fmt = HDF_LEFT | HDF_STRING;