BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.24k stars 4.61k forks source link

GPUImageView warning #2649

Open WhereFindYouAgin opened 4 years ago

WhereFindYouAgin commented 4 years ago

Main Thread Checker: UI API called on a background thread: .when I used GPUImageView this warring always happend , could you fix it。it happened in ios 13.3 Xcode 11.5.

截屏2020-08-11下午8 33 02
BartSimpsons commented 4 years ago
...
CGRect viewRect;
CALayer *viewLayer;
...

- (void)layoutSubviews {
    viewRect = self.bounds;
    viewLayer = self.layer;
}

...
CGSize currentViewSize = viewRect.size;
...

this is main thread question, use viewRect replace self.bounds

jxxnnee commented 3 years ago
__block CGRect currentBounds;
__block CGSize currentViewSize;
runOnMainQueueWithoutDeadlocking(^{
    currentBounds = self.bounds;
    currentViewSize = self.bounds.size;
});

use this