File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ Line wrap the file at 100 chars. Th
24
24
## [ Unreleased]
25
25
### Changed
26
26
- Bump minimum supported Rust version (MSRV) to 1.64.0.
27
+ - Breaking: Mark ` SCNetworkReachability::schedule_with_runloop ` and ` unschedule_from_runloop ` as
28
+ ` unsafe ` . They accept a raw pointer that it dereferences. Figuring out a safe API around this is
29
+ left as an exercise for the future.
27
30
28
31
### Fixed
29
32
- Fix memory leak in ` SCNetworkReachability::set_callback ` .
Original file line number Diff line number Diff line change @@ -186,7 +186,12 @@ impl SCNetworkReachability {
186
186
/// See [`SCNetworkReachabilityScheduleFromRunLoop`] for details.
187
187
///
188
188
/// [`SCNetworkReachabilityScheduleFromRunLoop`]: https://developer.apple.com/documentation/systemconfiguration/1514894-scnetworkreachabilityschedulewit?language=objc
189
- pub fn schedule_with_runloop (
189
+ ///
190
+ /// # Safety
191
+ ///
192
+ /// The `run_loop_mode` must not be NULL and must be a pointer to a valid run loop mode.
193
+ /// Use `core_foundation::runloop::kCFRunLoopCommonModes` if you are unsure.
194
+ pub unsafe fn schedule_with_runloop (
190
195
& self ,
191
196
run_loop : & CFRunLoop ,
192
197
run_loop_mode : CFStringRef ,
@@ -210,7 +215,12 @@ impl SCNetworkReachability {
210
215
/// See [`SCNetworkReachabilityUnscheduleFromRunLoop`] for details.
211
216
///
212
217
/// [`SCNetworkReachabilityUnscheduleFromRunLoop`]: https://developer.apple.com/documentation/systemconfiguration/1514899-scnetworkreachabilityunschedulef?language=objc
213
- pub fn unschedule_from_runloop (
218
+ ///
219
+ /// # Safety
220
+ ///
221
+ /// The `run_loop_mode` must not be NULL and must be a pointer to a valid run loop mode.
222
+ /// Use `core_foundation::runloop::kCFRunLoopCommonModes` if you are unsure.
223
+ pub unsafe fn unschedule_from_runloop (
214
224
& self ,
215
225
run_loop : & CFRunLoop ,
216
226
run_loop_mode : CFStringRef ,
You can’t perform that action at this time.
0 commit comments