Opened 5 years ago

Closed 5 years ago

#1861 closed defect (invalid)

av_lockmgr_register doesn't destroy the mutex

Reported by: John Owned by:
Priority: normal Component: avutil
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Hello,
av_lockmgr_register doesn't invoke callBack function with AV_LOCK_DESTROY after using a mutex;
log:

Create a mutex
Create a mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex
Lock the mutex
Unlock the mutex

Change History (4)

comment:1 Changed 5 years ago by heleppkes

At which point would you expect the mutex to be destroyed?
From that log, it seems you only call the register function once, it creates the two mutex objects it uses, and then just locks/unlocks them. It would only destroy them once you call it again.

comment:2 Changed 5 years ago by John

I expect that function must itself destroy the mutex after all manipulations, because it creates them

comment:3 Changed 5 years ago by heleppkes

And how would it know that you're done using it?
For all it knows, you may continue calling the APIs at any moment.

When your application closes, just call the register function with a NULL argument, and it will destroy the mutex.

comment:4 Changed 5 years ago by cehoyos

  • Keywords av_lockmgr_register removed
  • Priority changed from critical to normal
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.