lyx_mirror/src/DocumentClassPtr.h
Richard Heck ead697d4b6 Deal with memory issue reported some time ago in connection with DocumentClass
objects. The problem that led to the leak is that these objects can be held in
memory long after the Buffer that created them is gone, mostly due to their
use in the CutStack. So they were previously held in a storage facility, the
DocumentClassBundle. Unfortunately, they were now being created too often,
especially by cloning. It's not really a leak, because they're accessible, but
we weren't ever destroying them.

This new approach uses a shared_ptr instead.

Thanks to Vincent for pointing out const_pointer_cast.
2012-05-31 12:34:29 -04:00

25 lines
526 B
C++

// -*- C++ -*-
/**
* \file DocumentClassPtr.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Richard Heck
*
* Full author contact details are available in file CREDITS.
*/
#ifndef DOCUMENT_CLASS_PTR_H
#define DOCUMENT_CLASS_PTR_H
#include "support/shared_ptr.h"
namespace lyx {
class DocumentClass;
typedef shared_ptr<DocumentClass> DocumentClassPtr;
typedef shared_ptr<DocumentClass const> DocumentClassConstPtr;
}
#endif // DISPATCH_RESULT_H