Disable disabling wxWeakRef<T>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -719,7 +719,6 @@ WX_ARG_FEATURE(textbuf, [ --enable-textbuf use wxTextBuffer class]
|
|||||||
WX_ARG_FEATURE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
|
WX_ARG_FEATURE(textfile, [ --enable-textfile use wxTextFile class], wxUSE_TEXTFILE)
|
||||||
WX_ARG_FEATURE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
|
WX_ARG_FEATURE(timer, [ --enable-timer use wxTimer class], wxUSE_TIMER)
|
||||||
WX_ARG_FEATURE(variant, [ --enable-variant use wxVariant class], wxUSE_VARIANT)
|
WX_ARG_FEATURE(variant, [ --enable-variant use wxVariant class], wxUSE_VARIANT)
|
||||||
WX_ARG_FEATURE(weakref, [ --enable-weakref make wxEvtHandler trackable with wxWeakRef<>], wxUSE_WEAKREF)
|
|
||||||
WX_ARG_FEATURE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM)
|
WX_ARG_FEATURE(zipstream, [ --enable-zipstream use wxZip streams], wxUSE_ZIPSTREAM)
|
||||||
|
|
||||||
dnl URL-related classes
|
dnl URL-related classes
|
||||||
@@ -6099,10 +6098,6 @@ if test "$wxUSE_VARIANT" = "yes"; then
|
|||||||
AC_DEFINE(wxUSE_VARIANT)
|
AC_DEFINE(wxUSE_VARIANT)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_WEAKREF" = "yes"; then
|
|
||||||
AC_DEFINE(wxUSE_WEAKREF)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$wxUSE_FS_INET" = "yes"; then
|
if test "$wxUSE_FS_INET" = "yes"; then
|
||||||
AC_DEFINE(wxUSE_FS_INET)
|
AC_DEFINE(wxUSE_FS_INET)
|
||||||
fi
|
fi
|
||||||
|
@@ -299,14 +299,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif /* wxUSE_VARIANT */
|
#endif /* wxUSE_VARIANT */
|
||||||
|
|
||||||
#ifndef wxUSE_WEAKREF
|
|
||||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
|
||||||
# error "wxUSE_WEAKREF must be defined."
|
|
||||||
# else
|
|
||||||
# define wxUSE_WEAKREF 0
|
|
||||||
# endif
|
|
||||||
#endif /* wxUSE_WEAKREF */
|
|
||||||
|
|
||||||
#ifndef wxUSE_XLOCALE
|
#ifndef wxUSE_XLOCALE
|
||||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||||
# error "wxUSE_XLOCALE must be defined."
|
# error "wxUSE_XLOCALE must be defined."
|
||||||
|
@@ -2260,9 +2260,7 @@ protected:
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
|
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
, public wxTrackable
|
, public wxTrackable
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxEvtHandler();
|
wxEvtHandler();
|
||||||
@@ -2381,9 +2379,7 @@ public:
|
|||||||
|
|
||||||
// Avoid problems at exit by cleaning up static hash table gracefully
|
// Avoid problems at exit by cleaning up static hash table gracefully
|
||||||
void ClearEventHashTable() { GetEventHashTable().Clear(); }
|
void ClearEventHashTable() { GetEventHashTable().Clear(); }
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
void OnSinkDestroyed( wxEvtHandler *sink );
|
void OnSinkDestroyed( wxEvtHandler *sink );
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const wxEventTableEntry sm_eventTableEntries[];
|
static const wxEventTableEntry sm_eventTableEntries[];
|
||||||
@@ -2450,16 +2446,13 @@ protected:
|
|||||||
virtual void DoSetClientData( void *data );
|
virtual void DoSetClientData( void *data );
|
||||||
virtual void *DoGetClientData() const;
|
virtual void *DoGetClientData() const;
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// Search tracker objects for event connection with this sink
|
// Search tracker objects for event connection with this sink
|
||||||
wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *eventSink);
|
wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *eventSink);
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler)
|
DECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler)
|
||||||
};
|
};
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxEventConnectionRef represents all connections between two event handlers
|
// wxEventConnectionRef represents all connections between two event handlers
|
||||||
// and enables automatic disconnect when an event handler sink goes out of
|
// and enables automatic disconnect when an event handler sink goes out of
|
||||||
@@ -2508,7 +2501,6 @@ private:
|
|||||||
|
|
||||||
DECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef)
|
DECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef)
|
||||||
};
|
};
|
||||||
#endif // wxUSE_WEAKREF
|
|
||||||
|
|
||||||
// Post a message to the given event handler which will be processed during the
|
// Post a message to the given event handler which will be processed during the
|
||||||
// next event loop iteration.
|
// next event loop iteration.
|
||||||
|
@@ -235,16 +235,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -234,16 +234,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -234,16 +234,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -234,16 +234,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -234,16 +234,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -234,16 +234,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -196,8 +196,6 @@
|
|||||||
|
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
#define wxUSE_STREAMS 1
|
#define wxUSE_STREAMS 1
|
||||||
|
|
||||||
#if defined(__DMC__) || defined(__WATCOMC__) \
|
#if defined(__DMC__) || defined(__WATCOMC__) \
|
||||||
|
@@ -230,16 +230,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -233,16 +233,6 @@
|
|||||||
// Recommended setting: 0 unless you do plan to develop MT applications
|
// Recommended setting: 0 unless you do plan to develop MT applications
|
||||||
#define wxUSE_THREADS 1
|
#define wxUSE_THREADS 1
|
||||||
|
|
||||||
// Set wxUSE_WEAKREF to 1 t support use of weak references to common classes
|
|
||||||
// in wxWidgets (wxWeakRef<T>). Set to 0 if your compiler has problems with
|
|
||||||
// the template-based implementation (Embedded Visual C++ 4 for ARM has a bug
|
|
||||||
// in this area, Visual C compiler options "/vmm /vmg" may help then).
|
|
||||||
//
|
|
||||||
// Default is 1
|
|
||||||
//
|
|
||||||
// Recommended setting: 1
|
|
||||||
#define wxUSE_WEAKREF 1
|
|
||||||
|
|
||||||
// If enabled, compiles wxWidgets streams classes
|
// If enabled, compiles wxWidgets streams classes
|
||||||
//
|
//
|
||||||
// wx stream classes are used for image IO, process IO redirection, network
|
// wx stream classes are used for image IO, process IO redirection, network
|
||||||
|
@@ -196,8 +196,6 @@
|
|||||||
|
|
||||||
#define wxUSE_THREADS 0
|
#define wxUSE_THREADS 0
|
||||||
|
|
||||||
#define wxUSE_WEAKREF 0
|
|
||||||
|
|
||||||
#define wxUSE_STREAMS 0
|
#define wxUSE_STREAMS 0
|
||||||
|
|
||||||
#if defined(__DMC__) || defined(__WATCOMC__) \
|
#if defined(__DMC__) || defined(__WATCOMC__) \
|
||||||
|
@@ -1061,7 +1061,6 @@ wxEvtHandler::~wxEvtHandler()
|
|||||||
{
|
{
|
||||||
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it;
|
wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it;
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// Remove ourselves from sink destructor notifications
|
// Remove ourselves from sink destructor notifications
|
||||||
// (this has usually been been done, in wxTrackable destructor)
|
// (this has usually been been done, in wxTrackable destructor)
|
||||||
wxEvtHandler *eventSink = entry->m_eventSink;
|
wxEvtHandler *eventSink = entry->m_eventSink;
|
||||||
@@ -1075,7 +1074,6 @@ wxEvtHandler::~wxEvtHandler()
|
|||||||
delete evtConnRef;
|
delete evtConnRef;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // wxUSE_WEAKREF
|
|
||||||
|
|
||||||
if (entry->m_callbackUserData)
|
if (entry->m_callbackUserData)
|
||||||
delete entry->m_callbackUserData;
|
delete entry->m_callbackUserData;
|
||||||
@@ -1379,7 +1377,6 @@ void wxEvtHandler::Connect( int id, int lastId,
|
|||||||
// Insert at the front of the list so most recent additions are found first
|
// Insert at the front of the list so most recent additions are found first
|
||||||
m_dynamicEvents->Insert( (wxObject*) entry );
|
m_dynamicEvents->Insert( (wxObject*) entry );
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// Make sure we get to know when a sink is destroyed
|
// Make sure we get to know when a sink is destroyed
|
||||||
if ( eventSink && eventSink != this )
|
if ( eventSink && eventSink != this )
|
||||||
{
|
{
|
||||||
@@ -1389,7 +1386,6 @@ void wxEvtHandler::Connect( int id, int lastId,
|
|||||||
else
|
else
|
||||||
evtConnRef = new wxEventConnectionRef(this, eventSink);
|
evtConnRef = new wxEventConnectionRef(this, eventSink);
|
||||||
}
|
}
|
||||||
#endif // wxUSE_WEAKREF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
||||||
@@ -1400,7 +1396,6 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
|||||||
if (!m_dynamicEvents)
|
if (!m_dynamicEvents)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// Remove connection from tracker node (wxEventConnectionRef)
|
// Remove connection from tracker node (wxEventConnectionRef)
|
||||||
if ( eventSink && eventSink != this )
|
if ( eventSink && eventSink != this )
|
||||||
{
|
{
|
||||||
@@ -1408,7 +1403,6 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType,
|
|||||||
if ( evtConnRef )
|
if ( evtConnRef )
|
||||||
evtConnRef->DecRef();
|
evtConnRef->DecRef();
|
||||||
}
|
}
|
||||||
#endif // wxUSE_WEAKREF
|
|
||||||
|
|
||||||
wxList::compatibility_iterator node = m_dynamicEvents->GetFirst();
|
wxList::compatibility_iterator node = m_dynamicEvents->GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
@@ -1500,7 +1494,6 @@ void *wxEvtHandler::DoGetClientData() const
|
|||||||
return m_clientData;
|
return m_clientData;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_WEAKREF
|
|
||||||
// A helper to find an wxEventConnectionRef object
|
// A helper to find an wxEventConnectionRef object
|
||||||
wxEventConnectionRef *
|
wxEventConnectionRef *
|
||||||
wxEvtHandler::FindRefInTrackerList(wxEvtHandler *eventSink)
|
wxEvtHandler::FindRefInTrackerList(wxEvtHandler *eventSink)
|
||||||
@@ -1540,7 +1533,6 @@ void wxEvtHandler::OnSinkDestroyed( wxEvtHandler *sink )
|
|||||||
node = node_nxt;
|
node = node_nxt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // wxUSE_WEAKREF
|
|
||||||
|
|
||||||
#endif // wxUSE_BASE
|
#endif // wxUSE_BASE
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user