Warning: will cause memory leaks - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Warning: will cause memory leaks

Warning: will cause memory leaks 3 weeks 5 days ago #14138

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1
I'm creating a new PDFLayoutView, and a new Document, then doing Document.Open() and PDFLayoutView.PDFOpen().

Then when I want to view a second document, I'm doing PDFLayoutView.PDFClose() and Document.Close(), and creating a new Document (but reusing the PDFLayoutView).

I just noticed these warnings in my console:

"E/Bad Coding: Document object closed, but Page object not closed, will cause memory leaks."

Do I need to do something differently in my code? I see that the Page object has a Close() method, and I can get pages of the Document from the GetPage(n) method. But this seems like something that should be taken care of by the Document class.

Please Log in or Create an account to join the conversation.

Warning: will cause memory leaks 3 weeks 4 days ago #14139

  • radaee
  • radaee's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 846
  • Karma: 43
  • Thank you received: 12
to be sure: call PDFLayoutView.PDFClose() before Document.Close() invoked.
this log print when Page object finalized by GC, and Document object closed.

Please Log in or Create an account to join the conversation.

Warning: will cause memory leaks 3 weeks 4 days ago #14140

  • arlomedia
  • arlomedia's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 43
  • Thank you received: 1
Yes, I'm calling PDFLayoutView.PDFClose(), then Document.Close().

I went back to test it some more, and now it's no longer happening. I don't remember which device I was using when I saw this yesterday. If I see it again, I'll post more info.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum