Perhaps I don’t understand how to use SharedPtr and MakeObject, but the Visual Studio resource monitor shows this code using up lots of memory as it runs:
#include <Aspose.Words.Cpp/Model/Document/Document.h>
using namespace Aspose::Words;
using namespace Aspose::Words::Saving;
int main()
{
System::SharedPtr<Document> doc;
while ( true )
{
doc = System::MakeObject<Document>( System::String( "My Doc In.docx" ) );
doc->Save( System::String( "My Doc Out.docx" ) );
}
}
I have a library using Aspose.Words that uses a single Document object. In regular C++, I would normally delete the Document object, but delete doesn’t work on SharedPtr. Whenever I open a new document into that object, it seems like the old document is never removed from memory. Please help!