ancher-bohdan / ancher-bohdan/gl_cpp_course

Problem with deallocation of custom_string instance, which was copied

Abierto
#1 0 comentarios 0 reacciones 1 asignado Reclamado por @ancher-bohdan Ver en GitHub
bug
Lenguaje dominante
C++
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.