Free the pad private data on pad release instead of using a weak ref, which is not thread safe. Also, lock the content of the pad private using the element's object lock.
Free the pad private data on pad release instead of using a weak ref, which is not thread safe. Also, lock the content of the pad private using the element's object lock.