X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5526e819eca4465ed5520d49bccfebc6a28045e0..c9468a241baaa09bbc82eb45da40a1d15c630f4d:/samples/html/virtual/virtual.cpp diff --git a/samples/html/virtual/virtual.cpp b/samples/html/virtual/virtual.cpp index 99e848ee55..8672b7b277 100644 --- a/samples/html/virtual/virtual.cpp +++ b/samples/html/virtual/virtual.cpp @@ -10,7 +10,7 @@ #endif // For compilers that support precompilation, includes "wx/wx.h". -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -19,17 +19,17 @@ // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers #ifndef WX_PRECOMP - #include + #include "wx/wx.h" #endif -#include +#include "wx/html/htmlwin.h" // new handler class: -#include -#include +#include "wx/wfstream.h" +#include "wx/mstream.h" @@ -63,8 +63,11 @@ wxFSFile* MyVFS::OpenFile(wxFileSystem& fs, const wxString& location) "sub-3
" "", location.GetData(), location.GetData(), location.GetData(), location.GetData()); + + // WARNING: wxMemoryInputStream will not free buf. + // There is a memory leak here. str = new wxMemoryInputStream(buf, strlen(buf)); - f = new wxFSFile(str, location, "text/html", wxEmptyString); + f = new wxFSFile(str, location, "text/html", wxEmptyString, wxDateTime::Today()); return f; } @@ -196,7 +199,7 @@ wxHtmlWindow *html; // ... and attach this menu bar to the frame SetMenuBar(menuBar); - CreateStatusBar(1); + CreateStatusBar(2); html = new wxHtmlWindow(this); html -> SetRelatedFrame(this, "VFS Demo: '%s'");