unopool.cxx (e262f9e6) unopool.cxx (301f0c9f)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 52 unchanged lines hidden (view full) ---

61SvxUnoDrawPool::SvxUnoDrawPool( SdrModel* pModel ) throw()
62: PropertySetHelper( SvxPropertySetInfoPool::getOrCreate( SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS ) ), mpModel( pModel )
63{
64 init();
65}
66
67SvxUnoDrawPool::~SvxUnoDrawPool() throw()
68{
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 52 unchanged lines hidden (view full) ---

61SvxUnoDrawPool::SvxUnoDrawPool( SdrModel* pModel ) throw()
62: PropertySetHelper( SvxPropertySetInfoPool::getOrCreate( SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS ) ), mpModel( pModel )
63{
64 init();
65}
66
67SvxUnoDrawPool::~SvxUnoDrawPool() throw()
68{
69 // memory leak #119991: to release the secondary pool created in function SvxUnoDrawPool::init()
70 SfxItemPool* pSecondaryPool=mpDefaultsPool->GetSecondaryPool();
71 if (pSecondaryPool != NULL)
72 SfxItemPool::Free(pSecondaryPool);
73 // memory leak #119991
69 // memory leak #119991#: to release the secondary pool created in function SvxUnoDrawPool::init()
70 SfxItemPool* pSecondaryPool = mpDefaultsPool->GetSecondaryPool();
74
71
72 // #119991# delete master pool first, this will reset the pMaster entry in pSecondaryPool as needed.
73 // This is the needed order (see SdrModel::~SdrModel for example)
75 SfxItemPool::Free(mpDefaultsPool);
74 SfxItemPool::Free(mpDefaultsPool);
75
76 // delete pSecondaryPool if exists
77 if(pSecondaryPool)
78 {
79 SfxItemPool::Free(pSecondaryPool);
80 }
76}
77
78void SvxUnoDrawPool::init()
79{
80 mpDefaultsPool = new SdrItemPool();
81 SfxItemPool* pOutlPool=EditEngine::CreatePool();
82 mpDefaultsPool->SetSecondaryPool(pOutlPool);
83

--- 349 unchanged lines hidden ---
81}
82
83void SvxUnoDrawPool::init()
84{
85 mpDefaultsPool = new SdrItemPool();
86 SfxItemPool* pOutlPool=EditEngine::CreatePool();
87 mpDefaultsPool->SetSecondaryPool(pOutlPool);
88

--- 349 unchanged lines hidden ---