Issue 8012 - OOO_STABLE_1_PORTS/X11: pJobSetup->mpDriverData needs correct deallocation
Summary: OOO_STABLE_1_PORTS/X11: pJobSetup->mpDriverData needs correct deallocation
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.1
Hardware: Mac Mac OS X, all
: P2 Trivial (vote)
Target Milestone: OOo 1.0.4
Assignee: ed
QA Contact: issues@gsl
URL:
Keywords: merge_pending
: 7453 (view as issue list)
Depends on:
Blocks: 8607
  Show dependency tree
 
Reported: 2002-10-01 23:23 UTC by fa
Modified: 2006-11-15 17:52 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
cd to SRC_ROOT/vcl, patch -p0 < /path/to/patchfile, rebuild VCL (600 bytes, patch)
2002-10-01 23:24 UTC, fa
no flags Details | Diff
Adds retrieval of locale information from sal for Mac OS X. Supercedes previous patch. Apply to a clean checkout of the vcl module using the following commands: cd $SRC_ROOT/vcl ; patch -po < /path/to/patch/file (2.08 KB, patch)
2002-10-02 22:17 UTC, pluby
no flags Details | Diff
cd to SRC_ROOT/vcl and patch -p0 < /path/to/patchfile (1.48 KB, patch)
2002-11-21 22:49 UTC, fa
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description fa 2002-10-01 23:23:39 UTC
In vcl/source/gdi/print.cxx, pJobSetup->mpDriverData should be 'deleted' not deallocated with rtl_freeMemory().

The mpDriverData structure is created in source/gdi/jobset.cxx:
	if ( rJobSetup.mpDriverData )
	{
		mpDriverData = new BYTE[mnDriverDataLen];
		memcpy( mpDriverData, rJobSetup.mpDriverData, mnDriverDataLen );
	}

and also deleted there as well:
ImplJobSetup::~ImplJobSetup()
{
	delete[] mpDriverData;
}

However, when VCL needs to delete it in print.cxx, it gets rtl_freeMemory()'ed.  This is incorrect and causes a crash or freeze when printing in MacOS X.

Dan
Comment 1 fa 2002-10-01 23:24:16 UTC
Created attachment 3034 [details]
cd to SRC_ROOT/vcl, patch -p0 < /path/to/patchfile, rebuild VCL
Comment 2 christof.pintaske 2002-10-02 07:50:51 UTC
cp->pl: please take care of this one (also for beta)
Comment 3 philipp.lohmann 2002-10-02 10:05:35 UTC
That conflict was resolved by using rtl_allocateMemory and
rtl_freeMemory consistently. I'm not sure why some of the matching
files were never update in OOO_STABLE_PORTS; probably they were
changed after that branch was invented since the allocator/deallocator
mix was a major issue throughout the whole office. Please note that
mpDriverData may also be allocated in psprint. Please update to the
file revisions below.

pl->mh: please update the following files for ooo1.0:
vcl/source/gdi/jobset.cxx to rev 1.7
vcl/unx/source/gdi/salprnpsp.cxx to rev 1.16
psprint/source/printer/jobdata.cxx to rev 1.2
psprint/source/helper/strhelper.cxx to rev 1.3
psprint/source/helper/helper.cxx to rev 1.9
Comment 4 pluby 2002-10-02 22:17:22 UTC
Created attachment 3055 [details]
Adds retrieval of locale information from sal for Mac OS X. Supercedes previous patch. Apply to a clean checkout of the vcl module using the following commands: cd $SRC_ROOT/vcl ; patch -po < /path/to/patch/file
Comment 5 ed 2002-10-12 19:13:57 UTC
Reassigning issue to me, adding approval_pending
Comment 6 fa 2002-10-31 07:39:21 UTC
Note that issue 7453 is an earlier iteration of this and the fix for
print.cxx was committed to _PORTS.  The rest of the files listed below
need to have OOO_STABLE_1_PORTS added to their taglist however.

http://www.openoffice.org/issues/show_bug.cgi?id=7453

Dan
Comment 7 khendricks 2002-11-21 14:28:23 UTC
 Approved vcl 100202 patch 
 
Kevin 
 
Comment 8 fa 2002-11-21 22:49:46 UTC
Created attachment 3700 [details]
cd to SRC_ROOT/vcl  and patch -p0 < /path/to/patchfile
Comment 9 fa 2002-11-21 22:51:40 UTC
112002 patch removes patching of print.cxx delete/free changes as this
has already been done elsewhere.

Otherwise, patch is same as what was approved by Kevin.

112002 patch committed to OOO_STABLE_1_PORTS.

Dan
Comment 10 fa 2002-11-21 23:16:08 UTC
Changed to merge_pending.

Merge:
1)  vcl.OOO_STABLE_1_PORTS.112002.patch
2)  And update tags as relfected below.

Dan
Comment 11 stx123 2002-11-26 13:27:51 UTC
removed keyword "ooo1.0" in favour of a target milestone "OOo 1.0.2".
Comment 12 fa 2003-04-17 02:23:19 UTC
*** Issue 7453 has been marked as a duplicate of this issue. ***
Comment 13 fa 2003-08-04 05:40:13 UTC
Fixed in 103 GM.
Comment 14 philipp.lohmann 2006-11-15 17:52:01 UTC
closing