Review patches regarding memory leaks in pgadmin fat client

From: Sanket Mehta <sanket(dot)mehta(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Review patches regarding memory leaks in pgadmin fat client
Date: 2014-12-18 13:32:11
Message-ID: CA+yw=mONJuE-H1wbvxah86264zTZCPF=NQ5QXb5+Nqg_XizQ8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Akshay,

PFA the patch to resolve memory leaks in pgadmin desktop client.

Below are the files modified and scenario in which this memory leak will
occur.

*1. pgadmin/dlg/dlgProperty.cpp:*
*scenario 1:*
In table property dialog, memory leak occurs while filling the owner's
combo box in properties tab as in * dlgProperty::FillComboBox() *function
set was not being deleted.

*scenario 2:*
in Database property window, memory leak occurred while filling owner's
combo box in properties tab as in
*dlgDefaultSecurityProperty::AddUsers() *function
set was not being deleted.

*2. pgadmin/dlg/dlgSelectDatabase.cpp:*
*scenario 1: *
in step dialog, while selecting database output string using selection
button, memory leak occurred as in *dlgSelectDatabase::Initialize() *function
pgSet* res was not being deleted.

*scenario 2: *
in step dialog, while selecting the database output string using selection
button, when trying to connect to any database, memory leak occurred
as in *dlgSelectDatabase::OnSelActivate()
function *pgSet** *res was not being deleted.

*3. pgadmin/frm/frmEditGrid.cpp:*
*scenario:*
While opening table data in grid view, memory leak occurred in sqlTable
constructor as allColsSet was not being deleted

*4.pgadmin/utils/registry.cpp:*
*scenario: *
while reading the registery at the start of the client, pBuf buffer was not
being deleted after reading the registry value inside
*pgRegKey::QueryValue()* function.

*5.pgadmin/utils/sysSettings.cpp:*
*scenario:*
wxFileConfig* defaultSetting was not being deleted at the time of closing
pgadmin.

*6.pgadmin/schema/pgTypes.cpp:*
*Scenario:*
while expanding type node of composite type in object browser, memory leak
occurred because pgSet* set was not deleted in *pgType::ShowTreeDetails()*
function.

*7.pgadmin/schema/pgTrigger.cpp:*
*scenario:*
while expanding trigger node in object browser, memory leak occurred
because pgSet* res was not deleted in *pgTrigger::ReadColumnDetails()*
function.

*8. pgadmin/schema/pgIndex.cpp:*
*scenario:*
while expanding Index node in object browser, memory leak occurred because
pgSet* res was not deleted in *pgIndexBase::ReadColumnDetails()* function.

*9.pgadmin/schema/pgAggregate.cpp:*
*Scenario:*
While creating new aggregate function memory leak occurred because pgSet*
types was not deleted in *pgAggregateFactory::CreateObjects()* function.

*10.pgadmin/debugger/debugger.cpp:*
*scenario 1:*
while starting to debug a sql function in pgadmin, memory leak occurred
because in *debuggerFactory::startDialog()* function pgSet* res was not
deleted before any return statement

*scenario 2:*
While setting a break point in a sql function in pgadmin, memory leak
occurred because in *breakpointFactory::startDialog()* function pgSet* res
was not deleted before any return statement

*11.pgadmin/schema/gpExtTable.cpp:*
*Scenario:*
At the time of getting the sql while creating/modifying/deleting the
greenplum external Table memory leak occurred in function
gpExtTable::GetSql() as pgSet* extTable was not being deleted before return
statement.

*12.pgadmin/dd/ddmodel/ddDbReverseEngineering.cpp*
*Scenario 1:*
While reverse engineering wizard is open, memory was occurred when moving
from select table page as in function *ddImportDBUtils::getTable()* pgSet*
inhtables was not deleted.and another memory leak was there as in
functions *ddImportDBUtils::getAllRelationships()
and **ddImportDBUtils::isModelSameDbFk()* pgSet* foreignKeys was not
deleted before return statement.

Please review it and let me know if anything is missing.
I will also send further patches in case i find more memory leaks.

Regards,
Sanket Mehta
Sr Software engineer
Enterprisedb

Attachment Content-Type Size
memory_leak_pgadmin.patch application/octet-stream 9.4 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2014-12-18 15:58:39 pgAdmin III commit: Tag REL-1_20_0 has been created.
Previous Message sunset9002 2014-12-18 08:36:10 Feature request: option to highlight function calls in the SQL editor.