Thread View: comp.windows.ms.programmer
2 messages
2 total messages
Started by Marc WANDSCHNEIDER
Mon, 06 Apr 1992 00:45
delete operator
Author: Marc WANDSCHNEIDER
Date: Mon, 06 Apr 1992 00:45
Date: Mon, 06 Apr 1992 00:45
20 lines
1238 bytes
1238 bytes
Does the C++ Delete operator often cause the system to hang in Windows 3.x programming...? [This might be a faq, so if it is, could somebody point me to such a faq...] I've been trying to make sure that I clean up after myself in this program I'm writing, but for some reason, when I delete one object (and not another of the same type), the system just hangs, and the app freezes up forcing a soft reboot... Should I be using a windows memory allocation function...? Thanks! -- storm@cs.mcgill.ca McGill University C program run. Run Marc Wandschneider Montreal, CANADA Program run! PLEASE! Ever wonder how Worf got to be Security Officer on the Enterprise when the Capt gets kidnapped from the bridge every two episodes and Troy Beats him up?
Re: delete operator
Author: Greg Demichillie
Date: Tue, 14 Apr 1992 15:45
Date: Tue, 14 Apr 1992 15:45
33 lines
1559 bytes
1559 bytes
In article <1992Apr6.004508.8350@cs.mcgill.ca> storm@cs.mcgill.ca (Marc WANDSCHNEIDER) writes: > > > Does the C++ Delete operator often cause the system to hang in >Windows 3.x programming...? [This might be a faq, so if it is, could >somebody point me to such a faq...] > > I've been trying to make sure that I clean up after myself in >this program I'm writing, but for some reason, when I delete one object >(and not another of the same type), the system just hangs, and the app >freezes up forcing a soft reboot... > > Should I be using a windows memory allocation function...? > There is nothing magical about the delete operator regarding memory deallocation. It is a user-definable function. Many C++ implementations just map operator new and delete to malloc and free. You need to check what your particular development systems does. One problem you may be having is that you might be deleting a C++ object that represents a Windows object (i.e., brush, pen, window etc...) and you may end up deleting a Windows object that is currently selected into a DC. Hope this helps. -Greg -- Greg DeMichillie Software Design Engineer - Application Frameworks (AFX) gregde@microsoft.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads