Skip to content

Commit 7ce2295

Browse files
committed
fix: revert #74
1 parent d131cb8 commit 7ce2295

File tree

3 files changed

+0
-42
lines changed

3 files changed

+0
-42
lines changed

src/sys/generator.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,6 @@ impl Debug for Generator {
290290
}
291291
}
292292

293-
// Releasing `UniquePtr<Generator>` invokes joining threads.
294-
// However, on Windows, this causes a deadlock.
295-
// As a workaround, it is bypassed here.
296-
// See also https://github.com/jkawamoto/ctranslate2-rs/issues/64
297-
#[cfg(target_os = "windows")]
298-
impl Drop for Generator {
299-
fn drop(&mut self) {
300-
let ptr = std::mem::replace(&mut self.ptr, UniquePtr::null());
301-
unsafe {
302-
std::ptr::drop_in_place(ptr.into_raw());
303-
}
304-
}
305-
}
306-
307293
/// The set of generation options.
308294
///
309295
/// # Examples

src/sys/translator.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -566,20 +566,6 @@ impl Debug for Translator {
566566
}
567567
}
568568

569-
// Releasing `UniquePtr<Translator>` invokes joining threads.
570-
// However, on Windows, this causes a deadlock.
571-
// As a workaround, it is bypassed here.
572-
// See also https://github.com/jkawamoto/ctranslate2-rs/issues/64
573-
#[cfg(target_os = "windows")]
574-
impl Drop for Translator {
575-
fn drop(&mut self) {
576-
let ptr = std::mem::replace(&mut self.ptr, UniquePtr::null());
577-
unsafe {
578-
std::ptr::drop_in_place(ptr.into_raw());
579-
}
580-
}
581-
}
582-
583569
/// A translation result.
584570
///
585571
/// This struct is a Rust binding to the

src/sys/whisper.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -395,20 +395,6 @@ impl Debug for Whisper {
395395
}
396396
}
397397

398-
// Releasing `UniquePtr<Whisper>` invokes joining threads.
399-
// However, on Windows, this causes a deadlock.
400-
// As a workaround, it is bypassed here.
401-
// See also https://github.com/jkawamoto/ctranslate2-rs/issues/64
402-
#[cfg(target_os = "windows")]
403-
impl Drop for Whisper {
404-
fn drop(&mut self) {
405-
let ptr = std::mem::replace(&mut self.ptr, UniquePtr::null());
406-
unsafe {
407-
std::ptr::drop_in_place(ptr.into_raw());
408-
}
409-
}
410-
}
411-
412398
unsafe impl Send for ffi::Whisper {}
413399
unsafe impl Sync for ffi::Whisper {}
414400

0 commit comments

Comments
 (0)