Kaydet (Commit) cb8f2e44 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i125143# reduce helpex stack usage to prevent intermittent failures

moving the 1MB copy buffer from the stack to the heap solves the problem
that was first observed on the Windows buildbot.
üst 75f191b0
......@@ -36,6 +36,7 @@
#include <tools/urlobj.hxx>
#include <time.h>
#include <stdlib.h>
#include <boost/shared_ptr.hpp>
using namespace std;
//
......@@ -339,9 +340,6 @@ void Export::RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename ){
bool Export::CopyFile( const ByteString& source , const ByteString& dest )
{
// cout << "CopyFile( " << source.GetBuffer() << " , " << dest.GetBuffer() << " )\n";
static const int BUFFERSIZE = 0x100000;
char buf[ BUFFERSIZE ];
FILE* IN_FILE = fopen( source.GetBuffer() , "r" );
if( IN_FILE == NULL )
{
......@@ -357,6 +355,10 @@ bool Export::CopyFile( const ByteString& source , const ByteString& dest )
return false;
}
static const int BUFFERSIZE = 0x100000;
boost::shared_ptr<char> aScopedBuffer( new char[BUFFERSIZE] );
char* buf = aScopedBuffer.get();
bool bOk = true;
while( bOk )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment