In handleDataReceived(), when our connection is not the same as the conn_id of the incoming message, we (1) remove the window and (2) create a new one and add it.
However, (1) and (2) are not synchronized: when multiple threads go through this code concurrently, we could have a sequence 1-2-1, meaning the window is removed, a new one is created, but then - because another thread got conn_id != our conn_id true, the window will be removed again !
This means that a message #1 might get added to the new window and delivered to the app, and then the same thing could happen again, because we re-create the window again !
SOLUTION: synchronization around: check for conn_id match, removal and creation of the new window