adamwulf / JotUI

OpenGL based drawing view built for and used by Loose Leaf for iPad
http://getlooseleaf.com/opensource/
MIT License
268 stars 28 forks source link

Main Thread Checker: UI API called on a background thread: -[UIView contentScaleFactor] #43

Closed abrpatel closed 5 years ago

abrpatel commented 5 years ago

getting this error when I call the export function. I can't seem to resolve it. The export itself works fine though.

adamwulf commented 5 years ago

It's only logged to console, right? or is it also throwing an exception and stopping execution?

that's an unfortunate bug from long ago before they started logging that error

abrpatel commented 5 years ago

In production mode, it works fine, and saves and returns the image with no issues. In development mode, the first time you save, it slows the save process and actually points to the issue. I'm afraid that it might be a cause for rejection if I use the framework in the app when I submit an update with it.

adamwulf commented 5 years ago

For what it's worth, no one has sent me anything about it getting rejected, and it's currently this way in Loose Leaf which is still in the store. I last updated Loose Leaf on Jan 22, 2019, and it was approved then w/ JotUI.

abrpatel commented 5 years ago

Sounds good! I'll reopen the issue if anything does happen during review. Thanks!

abrpatel commented 5 years ago

The issue actually causes a memory leak, at every time you export. I'll leave it open until you get a chance to look at it when you're free.

adamwulf commented 5 years ago

well that's no good - which objects are leaking? does it leak in the included example app during export?

abrpatel commented 5 years ago

Testing now. Will let you know.

abrpatel commented 5 years ago
Screen Shot 2019-05-13 at 1 13 31 PM

Add this to the jotuiexample in the info.plist file

NSPhotoLibraryAddUsageDescription Our application needs permission to write photos...

now run instruments and draw something. press settings and click save, you get the above results. Leaks aren't even captured, it just freezes.

adamwulf commented 5 years ago

Ok thanks, i'll check it out. it'll likely be a few days before i'll have time to get to it

abrpatel commented 5 years ago

No worries. Just let me know, after that I'll retest and commit the NSData feature as well, as I'll make sure that code doesn't leak before submitting the PR for it.

abrpatel commented 5 years ago

Fixed issue in PR. It was a simple matter of placement.