Menu

#44 Cursor<T>::~Cursor() deletes cursor field repeatedly after assignment

v0.3.18
accepted
Gulliver
None
1
2015-04-01
2015-04-01
Anonymous
No

There is no operator= or copy constructor overloaded for Cursor class so compiler uses default assignment operator which simply copies corresponding fields. So if we need to do something like

Cursor c(*(dataSource->cursor()));

this will cause crash. As Cursor::cursor filed will be shared between objects and will be freed twice on the objects destruction.

Discussion

  • Gulliver

    Gulliver - 2015-04-01
    • status: open --> accepted
    • assigned_to: Gulliver
     
  • Gulliver

    Gulliver - 2015-04-01
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB