X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fba0ec77b2e319b56039a6fb09e15e251577ce6..4c420a80e0fb11511b235411875ba5d3e0eb8492:/src/common/sckfile.cpp?ds=sidebyside diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index c9f723a145..a5c148b90c 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -30,7 +30,7 @@ #include "wx/protocol/file.h" IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) -IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, FALSE) +IMPLEMENT_PROTOCOL(wxFileProto, wxT("file"), NULL, false) wxFileProto::wxFileProto() : wxProtocol() @@ -43,7 +43,13 @@ wxFileProto::~wxFileProto() wxInputStream *wxFileProto::GetInputStream(const wxString& path) { - return new wxFileInputStream(wxURL::ConvertFromURI(path)); + wxFileInputStream* retval = new wxFileInputStream(wxURL::ConvertFromURI(path)); + if (retval->Ok()) { + return retval; + } else { + delete retval; + return 0; + } } #endif // wxUSE_STREAMS && wxUSE_PROTOCOL_FILE