Memory issue in custom shared pointer | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Memory issue in custom shared pointer

Hi Tried to implement the shared pointer functionality: https://www.sololearn.com/en/compiler-playground/cgQM1tS8uM9X https://www.sololearn.com/en/compiler-playground/cgQM1tS8uM9X/?ref=app Can someone help me find issue in move semantic? I am getting issue , but could not find what is causing failure. https://code.sololearn.com/cgQM1tS8uM9X/?ref=app

2nd Dec 2023, 7:12 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
2 ответов
+ 1
you don't seem to check that counter is not a null pointer before dereferencing it ( line 97 ).
2nd Dec 2023, 3:58 PM
MO ELomari
0
Thanks. I thought it was due to double delete and not focused on this aspect. Correction done. Thanks again
2nd Dec 2023, 4:20 PM
Ketan Lalcheta
Ketan Lalcheta - avatar