ancher-bohdan / ancher-bohdan/gl_cpp_course

Problem with deallocation of custom_string instance, which was copied

Đang mở
#1 0 bình luận 0 reaction 1 người được giao Được @ancher-bohdan nhận Xem trên GitHub
bug
Ngôn ngữ chính
C++
Star
0
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.