use wxON_BLOCK_EXIT instead of just ON_BLOCK_EXIT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23636 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
#include "wx/defs.h"
|
#include "wx/defs.h"
|
||||||
|
|
||||||
|
#include "wx/except.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// helpers
|
// helpers
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -35,17 +37,11 @@ namespace wxPrivate
|
|||||||
if ( !guard.WasDismissed() )
|
if ( !guard.WasDismissed() )
|
||||||
{
|
{
|
||||||
// we're called from ScopeGuardImpl dtor and so we must not throw
|
// we're called from ScopeGuardImpl dtor and so we must not throw
|
||||||
#if wxUSE_EXCEPTIONS
|
wxTRY
|
||||||
try
|
|
||||||
#endif // wxUSE_EXCEPTIONS
|
|
||||||
{
|
{
|
||||||
guard.Execute();
|
guard.Execute();
|
||||||
}
|
}
|
||||||
#if wxUSE_EXCEPTIONS
|
wxCATCH_ALL() // do nothing, just eat the exception
|
||||||
catch ( ... )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif // wxUSE_EXCEPTIONS
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,27 +293,27 @@ typedef const wxScopeGuardImplBase& wxScopeGuard;
|
|||||||
// but this results in compiler warnings about unused variables and I
|
// but this results in compiler warnings about unused variables and I
|
||||||
// didn't find a way to work around this other than by having different
|
// didn't find a way to work around this other than by having different
|
||||||
// macros with different names
|
// macros with different names
|
||||||
#define ON_BLOCK_EXIT0(f) \
|
#define wxON_BLOCK_EXIT0(f) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
#define ON_BLOCK_EXIT_OBJ0(o, m) \
|
#define wxON_BLOCK_EXIT_OBJ0(o, m) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
#define ON_BLOCK_EXIT1(f, p1) \
|
#define wxON_BLOCK_EXIT1(f, p1) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f, p1); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f, p1); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
#define ON_BLOCK_EXIT_OBJ1(o, m, p1) \
|
#define wxON_BLOCK_EXIT_OBJ1(o, m, p1) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m, p1); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m, p1); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
#define ON_BLOCK_EXIT2(f, p1, p2) \
|
#define wxON_BLOCK_EXIT2(f, p1, p2) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f, p1, p2); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeGuard(f, p1, p2); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
#define ON_BLOCK_EXIT_OBJ2(o, m, p1, p2) \
|
#define wxON_BLOCK_EXIT_OBJ2(o, m, p1, p2) \
|
||||||
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m, p1, p2); \
|
wxScopeGuard wxMAKE_UNIQUE_NAME(scopeGuard) = wxMakeObjGuard(o, m, p1, p2); \
|
||||||
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
wxPrivate::Use(wxMAKE_UNIQUE_NAME(scopeGuard))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user