URL: <http://gna.org/patch/?7491>
Summary: Qt client: Use helper<> to propagate output_window_append Project: Freeciv Submitted by: louis94 Submitted on: jeu. 21 juil. 2016 02:35:58 UTC Category: client-qt Priority: 5 - Normal Status: None Privacy: Public Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Planned Release: Contains string changes: None _______________________________________________________ Details: This is a working demo of the class introduced in patch #7490. I use it to implement qtg_real_output_window_append so it needs to know neither who needs the data nor how to send it. There is a possible race condition if messages are sent very quickly after helper<chat_helper>::helper<chat_helper>() has registered an object, but before said object is fully initialized. Two proper solutions would be (1) locking the mutex from chatline_common.h or (2) creating the UI before entering the client main loop. The current code is protected by another mean (using NULL pointers). However, this protection isn't truly effective: sending messages before gui() is initialized would cause a segfault. There may also be problems because the variable behind gui() isn't set atomically. _______________________________________________________ File Attachments: ------------------------------------------------------- Date: jeu. 21 juil. 2016 02:35:58 UTC Name: qt-cleanup-chatline-helper.patch Size: 5 ko By: louis94 <http://gna.org/patch/download.php?file_id=27966> _______________________________________________________ Reply to this item at: <http://gna.org/patch/?7491> _______________________________________________ Message posté via/par Gna! http://gna.org/ _______________________________________________ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev