Two leak paths surfaced after a flip-then-record-then-pop session left the front camera claim stranded: 1. setDescription swapped instance.device without telling the plugin — devicesInUse still held the original cameraId. After dispose, releaseClaim only removed the *current* id, leaving the original stuck. Next push of the page hit device_busy on the original cam. Fix: setDescription handler now does a contention check, inserts the new id and drops the old (or rolls back on swap failure). 2. create's catch path called releaseClaim(for: instance), but if configureSession threw before instance.device was set, instance.currentCameraId is nil — and the cameraId we inserted on line above leaked. Fix: drop the known cameraId + audio claim explicitly in the catch.
17 KiB
17 KiB