View Single Post
Posts: 124 | Thanked: 10 times | Joined on Jan 2007 @ Italy
#7
thanks for reply! what if a pointer(heap allocation) is declared in a method but not returned?? it's not dead, but also out of scope, so not usefull?

i mean:
Code:
void function()
{
  QObject* obj =  new QObject;
  obj->doSomething()
}
is better use stack allocation this time?