It's based on the assumption that `parameter` always is heap-allocated from user side. Maybe this assumption is wrong. A possible solution is to have the user free `parameter` when the weak callback should be disposed.