mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
ead697d4b6
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.
25 lines
526 B
C++
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
|