-
- Downloads
Refactoring of the accountContainer logic
Before: - RingMainWindow has an unique_ptr to an AccountContainer accountContainer_. - each view / secondary class has its own *copy* of the account container pointer (given by ringmainwindow using accountContainer_.get()). - each time the reference to the struct Info is updated, accountContainer_ has to be reset()-ed and and the account container re-created by the RingMainWindow. This makes *all* copies of the account container pointer invalid (hence all view / secondary classes trying to access the account container before getting updated perform use-after-free / NULL pointer dereference). - These copies have to be manually updated ! (well, currently they are not updated at all) After: - RingMainWindow has a pointer to a struct Info from LRC. - Each view / secondary class has a pointer pointing to the struct Info pointer of RingMainWindow - Each time the reference to the struct Info is updated, the RingMainWindow updates its pointer. Since secondary classes and views hold a pointer to this pointer, they are automatically updated and there is no dangling pointer anymore. This requires no lrc side changes. Change-Id: I1329721920a3d42ad623f9fd7202b43700713eed Reviewed-by:Sebastien Blin <sebastien.blin@savoirfairelinux.com> Reviewed-by:
Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
Showing
- CMakeLists.txt 1 addition, 1 deletionCMakeLists.txt
- src/accountcontainer.h 0 additions, 37 deletionssrc/accountcontainer.h
- src/accountinfopointer.h 20 additions, 0 deletionssrc/accountinfopointer.h
- src/chatview.cpp 31 additions, 31 deletionssrc/chatview.cpp
- src/chatview.h 3 additions, 2 deletionssrc/chatview.h
- src/conversationpopupmenu.cpp 21 additions, 19 deletionssrc/conversationpopupmenu.cpp
- src/conversationpopupmenu.h 4 additions, 2 deletionssrc/conversationpopupmenu.h
- src/conversationsview.cpp 27 additions, 24 deletionssrc/conversationsview.cpp
- src/conversationsview.h 4 additions, 2 deletionssrc/conversationsview.h
- src/currentcallview.cpp 24 additions, 24 deletionssrc/currentcallview.cpp
- src/currentcallview.h 3 additions, 2 deletionssrc/currentcallview.h
- src/incomingcallview.cpp 13 additions, 13 deletionssrc/incomingcallview.cpp
- src/incomingcallview.h 3 additions, 2 deletionssrc/incomingcallview.h
- src/ringmainwindow.cpp 49 additions, 49 deletionssrc/ringmainwindow.cpp
- src/ringwelcomeview.cpp 11 additions, 14 deletionssrc/ringwelcomeview.cpp
- src/ringwelcomeview.h 5 additions, 3 deletionssrc/ringwelcomeview.h
Loading