Ticket #8190: filezilla.patch

File filezilla.patch, 1.9 KB (added by Tautvydas Andrikys, 7 years ago)
  • src/interface/FileZilla.cpp

    diff -r 85ba7f5d9236 -r fad3ef14c161 src/interface/FileZilla.cpp
    a b  
    475475#endif //__WXMAC__
    476476}
    477477
     478#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION == 8
     479void CFileZillaApp::ProcessPendingEvents() {
     480#if wxUSE_THREADS
     481    if ( !wxPendingEventsLocker )
     482        return;
     483#endif
     484
     485    // ensure that we're the only thread to modify the pending events list
     486    wxENTER_CRIT_SECT( *wxPendingEventsLocker );
     487
     488    if ( !wxPendingEvents )
     489    {
     490        wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
     491        return;
     492    }
     493
     494    // iterate until the list becomes empty
     495    wxList::compatibility_iterator node = wxPendingEvents->GetFirst();
     496        idleCounter = 100;
     497    while (node)
     498    {
     499        wxEvtHandler *handler = (wxEvtHandler *)node->GetData();
     500        wxPendingEvents->Erase(node);
     501
     502        // In ProcessPendingEvents(), new handlers might be add
     503        // and we can safely leave the critical section here.
     504        wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
     505
     506        handler->ProcessPendingEvents();
     507
     508        wxENTER_CRIT_SECT( *wxPendingEventsLocker );
     509
     510        node = idleCounter-- > 0 ? wxPendingEvents->GetFirst() : 0;
     511    }
     512
     513    wxLEAVE_CRIT_SECT( *wxPendingEventsLocker );
     514}
     515#endif
     516
    478517bool CFileZillaApp::LoadResourceFiles()
    479518{
    480519    m_resourceDir = GetDataDir(_T("/resources/menus.xrc"));
  • src/interface/filezillaapp.h

    diff -r 85ba7f5d9236 -r fad3ef14c161 src/interface/filezillaapp.h
    a b  
    3232
    3333    const CCommandLine* GetCommandLine() const { return m_pCommandLine; }
    3434
     35#if wxMAJOR_VERSION == 2 && wxMINOR_VERSION == 8
     36    virtual void ProcessPendingEvents();
     37private:
     38    char idleCounter;
     39public:
     40#endif
     41
    3542protected:
    3643    bool InitDefaultsDir();
    3744    bool LoadResourceFiles();