ancher-bohdan / ancher-bohdan/gl_cpp_course

Problem with deallocation of custom_string instance, which was copied

Aperta
#1 0 commenti 0 reazioni 1 assegnatario Rivendicata da @ancher-bohdan Vedi su GitHub
bug
Lingua principale
C++
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Some function (insert, append , = [assign operator]) might reallocate internal char buffer. If it happens with instance, witch was copied, in copy there was stale pointer to memory area, witch was already deallocaded. This cause a problem during deallocation of copy.

Need to fix this

Possible solution:
* Add additional field, witch contains reference counter to internal buffer.
* Use smart pointer instead of a usual one

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.