View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0026381 | Open CASCADE | OCCT:Foundation Classes | public | 2015-06-29 20:22 | 2016-04-20 15:48 |
Reporter | kgv | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 6.9.0 | ||||
Target Version | 7.0.0 | Fixed in Version | 7.0.0 | ||
Summary | 0026381: OSD_File - close file on destruction | ||||
Description | Current implementation of OSD_File keeps file opened on destruction which might lead to memory leaks or file locks. Since this behavior is unusual (e.g. std::ofstream closes file on destruction) it would be better to fix this to avoid possible errors. | ||||
Steps To Reproduce | Not required | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
Branch CR26381 has been created by akz. SHA-1: 4faf706ee4a38ed5fcc6c8c254458cf3174f5de8 Detailed log of new commits: Author: akz Date: Fri Sep 25 13:44:41 2015 +0300 0026381: OSD_File - close file on destruction Add destructor for OSD_File, that unlocks and close file. |
|
Branch CR26381 is ready for review |
|
I suppose that the following check:764 Standard_Boolean OSD_File::IsOpen()const{ 765 766 if (myPath.Name().Length()==0) 767 Standard_ProgramError::Raise("OSD_File::IsOpen : empty file name"); might lead to exception during destruction of empty OSD_File. |
|
Is this check kind of linux specific? Cause code for windows does not contain such check in the same functions. IsOpen() anyway returns False, if file path is empty. Do we really need to throw exception here? |
|
I believe raising exception there is senseless and should be removed |
|
Branch CR26381 has been updated forcibly by akz. SHA-1: 595f3c875ea6b8445c2e0feb6787cecefc9e2dce |
|
Senseless checks were removed from IsOpen(), IsLocked() and GetLock(). Branch CR26381 was updated. |
|
Branch CR26381 has been updated by abv. SHA-1: 813f90935bd3c963b73a8c803de5ee6e6c7d6855 Detailed log of new commits: Author: abv Date: Fri Sep 25 19:27:25 2015 +0300 Destructor of OSD_FileNode is made protected to avoid possibility of deleting descendants by pointer to base class |
|
Reviewed and corrected; please test |
|
Branch CR26381 has been updated forcibly by mkv. SHA-1: 3b4c5369a49e7adbef0ca5514fe78b10287ec3d9 |
|
Branch CR26381 has been updated forcibly by apv. SHA-1: b95d72ac467e640b00a21ce542e7f08754903962 |
|
Branch CR26381 has been rebased on the current master |
|
Dear BugMaster, Branch CR26381 from occt git-repository (and master from products git-repository) was compiled on Linux and Windows platforms and tested. SHA-1: b95d72ac467e640b00a21ce542e7f08754903962 Number of compiler warnings: occt component: Linux: 13 (13 on master) Windows: 0 (0 on master) products component: Linux: 39 (39 on master) Windows: 0 (0 on master) Regressions/Differences: Not detected Testing cases: Not needed Testing on Linux: Total MEMORY difference: 93373001 / 93274110 [+0.11%] Total CPU difference: 19437.86999999933 / 19594.749999999236 [-0.80%] Testing on Windows: Total MEMORY difference: 57926411 / 57934407 [-0.01%] Total CPU difference: 17980.987261999133 / 17727.251635499077 [+1.43%] |
|
Branch CR26381 has been deleted by kgv. SHA-1: b95d72ac467e640b00a21ce542e7f08754903962 |
occt: master 4485f3d0 2015-10-01 10:28:12
Committer: bugmaster Details Diff |
0026381: OSD_File - close file on destruction Add destructor for OSD_File, that unlocks and close file. Remove senseless checks from status functions in code for Linux. Destructor of OSD_FileNode is made protected to avoid possibility of deleting descendants by pointer to base class |
Affected Issues 0026381 |
|
mod - src/OSD/OSD_File.cxx | Diff File | ||
mod - src/OSD/OSD_File.hxx | Diff File | ||
mod - src/OSD/OSD_FileNode.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-06-29 20:22 | kgv | New Issue | |
2015-06-29 20:22 | kgv | Assigned To | => abv |
2015-09-25 00:51 |
|
Assigned To | abv => akz |
2015-09-25 00:51 |
|
Status | new => assigned |
2015-09-25 08:26 | kgv | Summary | OSD_File - close file on desctruction => OSD_File - close file on destruction |
2015-09-25 13:47 | git | Note Added: 0046128 | |
2015-09-25 13:51 |
|
Assigned To | akz => abv |
2015-09-25 13:51 |
|
Status | assigned => resolved |
2015-09-25 13:51 |
|
Steps to Reproduce Updated | |
2015-09-25 13:52 |
|
Steps to Reproduce Updated | |
2015-09-25 13:52 |
|
Note Added: 0046129 | |
2015-09-25 13:56 | kgv | Note Added: 0046130 | |
2015-09-25 14:26 |
|
Note Added: 0046131 | |
2015-09-25 14:26 |
|
Status | resolved => feedback |
2015-09-25 14:27 |
|
Note Edited: 0046131 | |
2015-09-25 14:35 |
|
Note Added: 0046132 | |
2015-09-25 14:35 |
|
Status | feedback => assigned |
2015-09-25 15:36 | git | Note Added: 0046136 | |
2015-09-25 15:38 |
|
Note Added: 0046137 | |
2015-09-25 15:38 |
|
Status | assigned => resolved |
2015-09-25 15:41 |
|
Note Edited: 0046137 | |
2015-09-25 19:27 | git | Note Added: 0046164 | |
2015-09-25 19:27 |
|
Note Added: 0046165 | |
2015-09-25 19:27 |
|
Assigned To | abv => bugmaster |
2015-09-25 19:27 |
|
Status | resolved => reviewed |
2015-09-25 20:46 | git | Note Added: 0046175 | |
2015-09-25 20:49 |
|
Assigned To | bugmaster => mkv |
2015-09-25 20:58 |
|
Assigned To | mkv => apv |
2015-09-28 14:15 | git | Note Added: 0046207 | |
2015-09-28 14:16 |
|
Note Added: 0046208 | |
2015-09-29 11:43 |
|
Test case number | => Not needed |
2015-09-29 11:50 |
|
Note Added: 0046246 | |
2015-09-29 11:50 |
|
Assigned To | apv => bugmaster |
2015-09-29 11:50 |
|
Status | reviewed => tested |
2015-10-02 14:56 | bugmaster | Changeset attached | => occt master 4485f3d0 |
2015-10-02 14:56 | bugmaster | Status | tested => verified |
2015-10-02 14:56 | bugmaster | Resolution | open => fixed |
2015-10-16 16:14 | git | Note Added: 0046881 | |
2016-04-20 15:44 |
|
Fixed in Version | => 7.0.0 |
2016-04-20 15:48 |
|
Status | verified => closed |