Issue 120668 - SdrModel, the member objects created in SdrModel::ImpCreateTables() leaks
Summary: SdrModel, the member objects created in SdrModel::ImpCreateTables() leaks
Status: CLOSED FIXED
Alias: None
Product: performance
Classification: Code
Component: code (show other issues)
Version: AOO 3.4.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: zhang jianfang
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 120975
  Show dependency tree
 
Reported: 2012-08-23 01:31 UTC by zhang jianfang
Modified: 2016-04-09 10:39 UTC (History)
0 users

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


Attachments
fix code patch (1.93 KB, patch)
2012-08-23 01:35 UTC, zhang jianfang
no flags Details | Diff
refix code patch (2.91 KB, patch)
2012-08-23 02:00 UTC, zhang jianfang
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description zhang jianfang 2012-08-23 01:31:32 UTC
In api
void SdrModel::ImpCreateTables()
{
	// der Writer hat seinen eigenen ColorTable
	if (!bExtColorTable) pColorTable=new XColorTable(aTablePath,(XOutdevItemPool*)pItemPool);
	pDashList    =new XDashList    (aTablePath,(XOutdevItemPool*)pItemPool);
	pLineEndList =new XLineEndList (aTablePath,(XOutdevItemPool*)pItemPool);
	pHatchList   =new XHatchList   (aTablePath,(XOutdevItemPool*)pItemPool);
	pGradientList=new XGradientList(aTablePath,(XOutdevItemPool*)pItemPool);
	pBitmapList  =new XBitmapList  (aTablePath,(XOutdevItemPool*)pItemPool);
}

Next time, when calling SdrModel::Setxxx(), for ex,
void            SetColorTable(XColorTable* pTable)       { pColorTable=pTable; }

The object is overwritten without free.
Comment 1 zhang jianfang 2012-08-23 01:35:32 UTC
Created attachment 79073 [details]
fix code patch
Comment 2 zhang jianfang 2012-08-23 01:42:20 UTC
Comment on attachment 79073 [details]
fix code patch

Sorry, the patch still has problem, need more study.
Comment 3 zhang jianfang 2012-08-23 02:00:25 UTC
Created attachment 79074 [details]
refix code patch

Move these api from header file to source file and add delete action,

  void SdrModel::SetColorTable(XColorTable* pTable)
  void SdrModel::SetDashList(XDashList* pList)
  void SdrModel::SetLineEndList(XLineEndList* pList)
  void SdrModel::SetHatchList(XHatchList* pList)
  void SdrModel::SetGradientList(XGradientList* pList)
  void SdrModel::SetBitmapList(XBitmapList* pList)
Comment 4 zhang jianfang 2012-09-04 02:19:12 UTC
Comment on attachment 79074 [details]
refix code patch

remove review tag since long time no response.
Comment 5 SVN Robot 2012-09-04 02:32:02 UTC
"zhangjf" committed SVN revision 1380436 into trunk:
#i120668#, when calling SdrModel::Setxxx(), need free old object at firstFoun...
Comment 6 zhang jianfang 2012-09-04 02:35:30 UTC
Change to resolved state.
Comment 7 Marcus 2016-04-09 10:39:37 UTC
fixed in 4.0.0