Skip to content

Commit

Permalink
Merge pull request pnordahl#3 from schmidek/master
Browse files Browse the repository at this point in the history
fix prematurely dropped mutex lock guard
  • Loading branch information
pnordahl authored Aug 1, 2019
2 parents c007b6c + 86907d3 commit cf97750
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl Context {
}
}
pub fn init(&mut self, opts: InitOptions) -> Result<(), PostalError> {
let _ = self.mutex.lock();
let _guard = self.mutex.lock();
unsafe {
if !libpostal_setup() {
return Err(PostalError::LibpostalSetup);
Expand Down Expand Up @@ -222,7 +222,7 @@ impl Context {
opts: &mut ExpandAddressOptions,
) -> Result<Expansions, PostalError> {
if self.setup_done && self.expand_address_enabled {
let _ = self.mutex.lock();
let _guard = self.mutex.lock();
unsafe {
match CString::new(a) {
Ok(c_string) => {
Expand All @@ -245,7 +245,7 @@ impl Context {
opts: &mut ParseAddressOptions,
) -> Result<Components, PostalError> {
if self.setup_done && self.parse_address_enabled {
let _ = self.mutex.lock();
let _guard = self.mutex.lock();
unsafe {
match CString::new(a) {
Ok(c_string) => {
Expand Down

0 comments on commit cf97750

Please sign in to comment.