MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032616Community[OCCT] OCCT:Application Frameworkpublic2021-10-12 13:372021-10-16 13:58
Reporterocc_siddhesh_nikam 
Assigned Tokgv 
PrioritynormalSeverityjust a question 
StatusnewResolutionopen 
PlatformWindowsOSWindowsOS Version8.1
Product Version[OCCT] 7.5.0 
Target VersionFixed in Version 
Summary0032616: Erro on debugging (Standard_MMgrRaw::Free)
DescriptionHello Sir,

I have just started a new project with OCCT 7.5.0.

I have simply added following lines in "Application.cpp" file generated by "MFC":

   # Handle(Aspect_DisplayConnection) aDisplayConnection;
   # myGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);

It is working properly.

But when I close the Main Window, the code throws an error by opening a file
<Standard_MMgrRaw.cxx>

   # void Standard_MMgrRaw::Free(Standard_Address theStorage)
   # {
   # free(theStorage);
   # }

Is it a memory leak due to dynamic memory allocation of "Handle" Graphic3d_GraphicDriver?

How to resolve this? Please help.

Thanks.

TagsNo tags attached.
Test case number
Attached Filespng file icon memory leak error occt 7.5.png (47,927 bytes) 2021-10-14 13:55
png file icon release build_error.png (13,296 bytes) 2021-10-14 13:57
png file icon OpenGI_GraphicDriver.png (97,132 bytes) 2021-10-16 10:26

- Relationships

-  Notes
(0104604)
kgv (developer)
2021-10-12 13:52

Provided information is incomplete.

>I have simply added following lines in "Application.cpp" file generated by "MFC":
> # Handle(Aspect_DisplayConnection) aDisplayConnection;
> # myGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
There is no declaration of myGraphicDriver in quoted code, so I suppose that the sample is much more complicated than "simply added following lines" to a freshly written project.
(0104606)
occ_siddhesh_nikam (reporter)
2021-10-12 14:25
edited on: 2021-10-12 17:17

Thanks for the reply.

In the "Application.h" header file, I have already declared a variable
     # Handle(Graphic3d_GraphicDriver) myGraphicDriver;

It is giving the error.

I never faced this error in older version of OCCT (OCCT 7.2.0).

Please help! Thanks.

(0104631)
occ_siddhesh_nikam (reporter)
2021-10-14 10:10

Hello kgv,

As I understood, a "Handle" is a smart_pointer in OCCT with automatic memory deallocation. Is it correct?

I am not getting why the above error is generating?
Is it a bug in OCCT 7.5?

Please guide!
(0104632)
kgv (developer)
2021-10-14 11:37

> a "Handle" is a smart_pointer in OCCT with automatic memory deallocation.
Yes.

> I am not getting why the above error is generating?
The problem description is unclear.
I would guess that this might be related to MFC-specific stuff overriding memory allocation routines for debugging purposes.

Are you running Debug/Release application paired with Debug/Release OCCT builds?
Does it happen in both Debug and Release builds?
(0104634)
occ_siddhesh_nikam (reporter)
2021-10-14 13:54
edited on: 2021-10-14 13:59

Hello kgv,

> Are you running Debug/Release application paired with Debug/Release OCCT
builds?
 * I have built OCCT 7.5 with CMake and followed the occt_mfc example:
   "04_Viewer3D."
 * I have set Compiler, Linker and Runtime properties by referring "Viewer3D.sln"

> Does it happen in both Debug and Release builds?
It is throwing an error when I close the window by pressing "X" button in both Release and Debug version.

Screenshot attached: 1) error with "Debug" version (black background).
                     2) error with "Release" version.

Thanks.

(0104668)
occ_siddhesh_nikam (reporter)
2021-10-16 10:35

Dear kgv,

I am unable to find "why I am getting Graphic_Driver related run-time error."

What is wrong in the following lines?
     # Handle(Graphic3d_GraphicDriver) myGraphicDriver;
     # Handle(Aspect_DisplayConnection) aDisplayConnection;
     # myGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);

Is it related to occt-project properties in Visual Studio 2019? or what else?

I request you, please kindly suggest some ways to overcome this problem.

Thanks.
(0104673)
kgv (developer)
2021-10-16 11:38
edited on: 2021-10-16 11:39

> What is wrong in the following lines?
There is nothing wrong with these particular lines - it is a usual allocation of an object, that could be seen in OCCT samples.
Have you tried building samples coming with OCCT - do they crash in your environment?
Normally, Graphic3d_GraphicDriver instance is not stored as a class field at GUI level - there is no point in it, as it is stored inside created V3d_Viewer;
moreover, many applications create graphic driver as a singleton.

> I request you, please kindly suggest some ways to overcome this problem.
This bugtracker is focused on bug reports.
You might get a better help from community on user forums or using OCC support services.
https://dev.opencascade.org/forums [^]

(0104690)
occ_siddhesh_nikam (reporter)
2021-10-16 13:58

> Have you tried building samples coming with OCCT - do they crash in your environment?
Yes, I have tried OCCT samples. All are working without error under same environment.

Thanks for the reply.

- Issue History
Date Modified Username Field Change
2021-10-12 13:37 occ_siddhesh_nikam New Issue
2021-10-12 13:37 occ_siddhesh_nikam Assigned To => kgv
2021-10-12 13:50 kgv Severity minor => just a question
2021-10-12 13:52 kgv Note Added: 0104604
2021-10-12 14:25 occ_siddhesh_nikam Note Added: 0104606
2021-10-12 14:26 occ_siddhesh_nikam Note Edited: 0104606 View Revisions
2021-10-12 14:28 occ_siddhesh_nikam Note Edited: 0104606 View Revisions
2021-10-12 17:17 occ_siddhesh_nikam Note Edited: 0104606 View Revisions
2021-10-14 10:10 occ_siddhesh_nikam Note Added: 0104631
2021-10-14 11:37 kgv Note Added: 0104632
2021-10-14 13:54 occ_siddhesh_nikam Note Added: 0104634
2021-10-14 13:55 occ_siddhesh_nikam File Added: memory leak error occt 7.5.png
2021-10-14 13:57 occ_siddhesh_nikam File Added: release build_error.png
2021-10-14 13:59 occ_siddhesh_nikam Note Edited: 0104634 View Revisions
2021-10-16 10:26 occ_siddhesh_nikam File Added: OpenGI_GraphicDriver.png
2021-10-16 10:35 occ_siddhesh_nikam Note Added: 0104668
2021-10-16 11:38 kgv Note Added: 0104673
2021-10-16 11:38 kgv Note Edited: 0104673 View Revisions
2021-10-16 11:39 kgv Note Edited: 0104673 View Revisions
2021-10-16 13:58 occ_siddhesh_nikam Note Added: 0104690


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker