1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0023500: MFC samples are crached on 3D visualisation

void FreeTexture() in OpenGl_TextureBox.cxx - avoid possible NULL-pointer dereference

after debug x64 compilation the executable viewer3d had been moved to the bin folder. now executable viewer3d located in bind folder.
This commit is contained in:
ibs 2012-11-09 12:11:20 +04:00
parent dbf33db17a
commit 1c4ff5c647
2 changed files with 5 additions and 2 deletions

View File

@ -240,7 +240,7 @@
</ResourceCompile> </ResourceCompile>
<Link> <Link>
<AdditionalDependencies>TKBRep.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKV2d.lib;TKV3d.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>TKBRep.lib;FWOSPlugin.lib;PTKernel.lib;TKBool.lib;TKCAF.lib;TKCDF.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKMath.lib;TKOffset.lib;TKPCAF.lib;TKPrim.lib;TKPShape.lib;TKService.lib;TKTopAlgo.lib;TKV2d.lib;TKV3d.lib;mfcsample.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>../../../../x64\vc10\bin/Viewer3d.exe</OutputFile> <OutputFile>../../../../x64\vc10\bind/Viewer3d.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\..\x64\vc10\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>..\..\..\..\x64\vc10\libd;$(CSF_OPT_LIB64D);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>

View File

@ -684,7 +684,10 @@ void FreeTexture (const Handle(OpenGl_Context)& theContext,
for (int i = 0; i < textab(ID).contextdata.Length(); ++i) for (int i = 0; i < textab(ID).contextdata.Length(); ++i)
{ {
Handle(OpenGl_ResourceTexture) aResource = new OpenGl_ResourceTexture (textab(ID).contextdata(i).number); Handle(OpenGl_ResourceTexture) aResource = new OpenGl_ResourceTexture (textab(ID).contextdata(i).number);
theContext->DelayedRelease (aResource);
if (!theContext.IsNull()) {
theContext->DelayedRelease (aResource);
}
} }
texdata(data).status = TEXDATA_NONE; texdata(data).status = TEXDATA_NONE;