From 20b7c401adf27ba2d2127cfc6e33f0d8977b3e2a Mon Sep 17 00:00:00 2001 From: Sean Rhea Date: Mon, 24 Aug 2009 19:54:32 -0700 Subject: [PATCH] naked new okay for Qt classes with parent pointers --- src/style.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/style.txt b/src/style.txt index 96b0ced5f..9c213be01 100644 --- a/src/style.txt +++ b/src/style.txt @@ -16,8 +16,11 @@ them when possible. -- Sean variable, declare it "static" withing a .cpp file. - Only call C++'s operator new within the constructors and reset() functions - of std::auto_ptr, boost::scoped_pointer, etc. Never call delete explicitly. - Do not use malloc or free unless forced to by an external C library. + of std::auto_ptr, boost::scoped_pointer, etc. or when passing a parent + pointer to a Qt class (so that the parent deletes the child). Never call + delete explicitly. + +- Do not use malloc or free unless forced to by an external C library. - Allocate large buffers on the heap, not on the stack.