Exemplo n.º 1
0
CPDFSDK_PageView::~CPDFSDK_PageView()
{
    CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
    int nAnnotCount = m_fxAnnotArray.GetSize();

    for (int i=0; i<nAnnotCount; i++)
    {
        CPDFSDK_Annot* pAnnot = (CPDFSDK_Annot*)m_fxAnnotArray.GetAt(i);
        //if there is a focused annot on the page, we should kill the focus first.
        if(pAnnot == m_pSDKDoc->GetFocusAnnot())
            KillFocusAnnot();
        CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
        ASSERT(pAnnotHandlerMgr);
        pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
    }
    m_fxAnnotArray.RemoveAll();

        delete m_pAnnotList;
        m_pAnnotList = NULL;

        m_page->RemovePrivateData((void*)m_page);
        if(m_bTakeOverPage) {
            delete m_page;
        }
}
Exemplo n.º 2
0
CPDFSDK_PageView::~CPDFSDK_PageView() {
  CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
  CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
  for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray)
    pAnnotHandlerMgr->ReleaseAnnot(pAnnot);
  m_fxAnnotArray.clear();

  m_pAnnotList.reset();

  m_page->RemovePrivateData((void*)m_page);
  if (m_bTakeOverPage) {
    delete m_page;
  }
}