From cbaa866f0ac4b4e8dd7243f94b7717312fd5ce30 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 30 Mar 2007 15:39:49 +0000 Subject: [PATCH] use wxCHECK instead of wxASSERT to avoid use of NULL pointer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/dragimgg.cpp | 15 ++++++--------- src/motif/mdi.cpp | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/generic/dragimgg.cpp b/src/generic/dragimgg.cpp index 7ea5a4fabc..1992db6c9b 100644 --- a/src/generic/dragimgg.cpp +++ b/src/generic/dragimgg.cpp @@ -236,7 +236,7 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, bool fullScreen, wxRect* rect) { - wxASSERT_MSG( (window != 0), wxT("Window must not be null in BeginDrag.")); + wxCHECK_MSG( window, false, wxT("Window must not be null in BeginDrag.")); // The image should be offset by this amount m_offset = hotspot; @@ -249,15 +249,12 @@ bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot, m_isDirty = false; m_isDirty = false; - if (window) - { - window->CaptureMouse(); + window->CaptureMouse(); - if (m_cursor.Ok()) - { - m_oldCursor = window->GetCursor(); - window->SetCursor(m_cursor); - } + if (m_cursor.Ok()) + { + m_oldCursor = window->GetCursor(); + window->SetCursor(m_cursor); } // Make a copy of the window so we can repair damage done as the image is diff --git a/src/motif/mdi.cpp b/src/motif/mdi.cpp index 09894eea98..1373b0b925 100644 --- a/src/motif/mdi.cpp +++ b/src/motif/mdi.cpp @@ -349,9 +349,9 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, wxMDIClientWindow* clientWindow = parent->GetClientWindow(); - wxASSERT_MSG( (clientWindow != (wxWindow*) NULL), "Missing MDI client window."); + wxCHECK_MSG( clientWindow, false, "Missing MDI client window." ); - if (clientWindow) clientWindow->AddChild(this); + clientWindow->AddChild(this); SetMDIParentFrame(parent); -- 2.45.2