// Purpose: Dynamic loading framework
// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's
// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux)
// Purpose: Dynamic loading framework
// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's
// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux)
wxPluginLibrary *wxPluginLibrary::RefLib()
{
wxCHECK_MSG( m_linkcount > 0, NULL,
wxPluginLibrary *wxPluginLibrary::RefLib()
{
wxCHECK_MSG( m_linkcount > 0, NULL,
bool wxPluginLibrary::UnrefLib()
{
wxASSERT_MSG( m_objcount == 0,
bool wxPluginLibrary::UnrefLib()
{
wxASSERT_MSG( m_objcount == 0,
// though, as there is currently no way to Unregister it without it.
wxASSERT_MSG( m_linkcount == 1,
// though, as there is currently no way to Unregister it without it.
wxASSERT_MSG( m_linkcount == 1,
{
if( info->IsKindOf(CLASSINFO(wxModule)) )
{
wxModule *m = wxDynamicCast(info->CreateObject(), wxModule);
{
if( info->IsKindOf(CLASSINFO(wxModule)) )
{
wxModule *m = wxDynamicCast(info->CreateObject(), wxModule);
// XXX: Watch this, a different hash implementation might break it,
// a good hash implementation would let us fix it though.
// XXX: Watch this, a different hash implementation might break it,
// a good hash implementation would let us fix it though.
// we have created entry just above
if ( !entry->UnrefLib() )
{
// ... so UnrefLib() is supposed to delete it
// we have created entry just above
if ( !entry->UnrefLib() )
{
// ... so UnrefLib() is supposed to delete it