ancher-bohdan / ancher-bohdan/gl_cpp_course
Problem with deallocation of custom_string instance, which was copied
Offen
bug
- Vorherrschende Sprache
- C++
- Sterne
- 0
- Forks
- 0
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.