valgrind check: do not read potentially deleted variables

let's see if it solves the occational crash in test_highlevel.py
I think is better to save some how. In second parameter for example shared pointer to himself.