- Posts: 56
- Thank you received: 1
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Warning: will cause memory leaks
IP: 97.115.135.13
7 years 11 months ago #14138
by arlomedia
Warning: will cause memory leaks was created by arlomedia
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.
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.
IP: 111.196.240.101
7 years 11 months ago #14139
by radaee
Replied by radaee on topic Warning: will cause memory leaks
to be sure: call PDFLayoutView.PDFClose() before Document.Close() invoked.
this log print when Page object finalized by GC, and Document object closed.
this log print when Page object finalized by GC, and Document object closed.
IP: 97.115.135.13
7 years 11 months ago #14140
by arlomedia
Replied by arlomedia on topic Warning: will cause memory leaks
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.
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.
Time to create page: 0.396 seconds