longitachi / ZLPhotoBrowser

Wechat-like image picker. Support select photos, videos, gif and livePhoto. Support edit image and crop video. 微信样式的图片选择器,支持预览/相册内拍照及录视频、拖拽/滑动选择,编辑图片/视频,支持多语言国际化等功能;
MIT License
4.71k stars 950 forks source link

iOS17编辑视频崩溃 #915

Open GodLiek opened 3 days ago

GodLiek commented 3 days ago

Issue Description

Description and Steps

ZLEditVideoViewController.m第408行,为啥要这么写timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self), selector: #selector(playPartVideo), userInfo: nil, repeats: true),我这边跑起来会崩溃,改成这样就没问题:timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self).target, selector: #selector(playPartVideo), userInfo: nil, repeats: true)

Info

ZLPhotoBrowser version: e.g. 4.5.3 Device: e.g. iPhone 11 Pro Max Device version: e.g. iOS 17.2.1 Xcode version: e.g. Xcode 15.3

Configuration code of ZLPhotoConfiguration

   /// - Parameter type: 0:视频 1:照片
    func selectImage(type:Int){
        let ps = ZLPhotoPreviewSheet()
        let psConfig = ZLPhotoConfiguration.default()
        if type == 0{
            psConfig.maxSelectVideoDuration(120)
            psConfig.minSelectVideoDuration(3)
            psConfig.allowSelectVideo = true
            psConfig.allowSelectImage = false
            psConfig.maxSelectCount(1)
            psConfig.allowEditVideo = true
        }else{
            psConfig.allowSelectImage = true
            psConfig.allowSelectVideo = false
            psConfig.maxSelectCount(9)
        }
}
longitachi commented 3 days ago

这么写是为了避免self和timer之间的循环引用。有崩溃的堆栈吗?

longitachi commented 3 days ago

我找了个iPhone15Pro 17.4.1的系统试了下,没有遇到crash,应该不是必现,或者跟机型有关