MCPcopy Create free account
hub / github.com/ashkulz/NppFTP / Clear

Method Clear

src/FTPSession.cpp:526–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526int FTPSession::Clear() {
527 if (m_mainQueue)
528 m_mainQueue->ClearQueue();
529 if (m_transferQueue)
530 m_transferQueue->ClearQueue();
531
532 if (m_transferWrapper) {
533 m_transferWrapper->Abort();
534 }
535 if (m_mainWrapper) {
536 m_mainWrapper->Abort();
537 }
538
539 if (m_transferQueue) {
540 m_transferQueue->Deinitialize();
541 delete m_transferQueue;
542 m_transferQueue = NULL;
543 }
544 if (m_mainQueue) {
545 m_mainQueue->Deinitialize();
546 delete m_mainQueue;
547 m_mainQueue = NULL;
548 }
549
550 QueueDisconnect * opdisc = new QueueDisconnect(m_hNotify);
551
552 if (m_transferWrapper) {
553 //Always perform disconnect operation, if if no connection present
554 //Allows for cleanup
555 //if (m_transferWrapper->IsConnected()) {
556 opdisc->SetClient(m_transferWrapper);
557 opdisc->SendNotification(QueueOperation::QueueEventStart);
558 opdisc->Perform();
559 opdisc->SendNotification(QueueOperation::QueueEventEnd);
560 //}
561 delete m_transferWrapper;
562 m_transferWrapper = NULL;
563 }
564
565 if (m_mainWrapper) {
566 //Always perform disconnect operation, if if no connection present
567 //Allows for cleanup
568 //if (m_mainWrapper->IsConnected()) {
569 opdisc->SetClient(m_mainWrapper);
570 opdisc->SendNotification(QueueOperation::QueueEventStart);
571 opdisc->Perform();
572 opdisc->SendNotification(QueueOperation::QueueEventEnd);
573 //}
574 delete m_mainWrapper;
575 m_mainWrapper = NULL;
576 }
577
578 delete opdisc;
579
580 return 0;
581}

Callers

nothing calls this directly

Calls 6

ClearQueueMethod · 0.80
SetClientMethod · 0.80
SendNotificationMethod · 0.80
PerformMethod · 0.80
AbortMethod · 0.45
DeinitializeMethod · 0.45

Tested by

no test coverage detected