1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0031785: [REGRESSION] Application Framework - application crashes on reading XBF document in background thread

Class CDF_Session is removed.

Integrated previously but not described:

0029195: OCAF - ensure thread safety for different documents.

Static local variables are eliminated in PCDM package.
Global documents metadata look-up table and directory of opened documents are removed.
Look-up table is maintained now as field in instances of the CDM_Application class.
Methods providing iteration by components are removed from class CDF_Store; signature of methods returned Standard_ExtString is changed to return Handle(TCollection_HExtendedString).
Support of different "Presentations" of documents is eliminated.
This commit is contained in:
abv
2020-09-22 15:24:54 +03:00
committed by bugmaster
parent 0e57793fc6
commit 8a39adb7d8
33 changed files with 230 additions and 479 deletions

View File

@@ -19,8 +19,6 @@
#include <AIS_InteractiveObject.hxx>
#include <AIS_ListOfInteractive.hxx>
#include <CDF_Session.hxx>
#include <inspector/DFBrowserPane_AttributePaneAPI.hxx>
#include <inspector/DFBrowser_AttributePaneStack.hxx>
@@ -439,15 +437,6 @@ void DFBrowser_Window::Init (const NCollection_List<Handle(Standard_Transient)>&
}
return;
}
else
{
if (anApplication.IsNull() && CDF_Session::Exists()) {
Standard_ThreadId anID = OSD_Thread::Current();
Handle(CDF_Application) anApp;
CDF_Session::CurrentSession()->FindApplication(anID, anApp);
anApplication = Handle(TDocStd_Application)::DownCast (anApp);
}
}
myModule = new DFBrowser_Module();
myModule->CreateViewModel (myMainWindow);
@@ -503,28 +492,18 @@ void DFBrowser_Window::OpenFile (const TCollection_AsciiString& theFileName)
anOCAFViewModel->Reset();
//! close previous documents to open new document
Handle(TDocStd_Application) anApplication;
if (CDF_Session::Exists())
Handle(TDocStd_Application) anApplication = myModule->GetTDocStdApplication();
if (!anApplication.IsNull())
{
Handle(CDF_Session) aSession = CDF_Session::CurrentSession();
if (!aSession.IsNull())
for (int aDocId = 1, aNbDocuments = anApplication->NbDocuments(); aDocId <= aNbDocuments; aDocId++)
{
Standard_ThreadId anID = OSD_Thread::Current();
Handle(CDF_Application) anApp;
CDF_Session::CurrentSession()->FindApplication(anID, anApp);
anApplication = Handle(TDocStd_Application)::DownCast (anApp);
if (!anApplication.IsNull())
{
for (int aDocId = 1, aNbDocuments = anApplication->NbDocuments(); aDocId <= aNbDocuments; aDocId++)
{
Handle(TDocStd_Document) aDocument;
anApplication->GetDocument (aDocId, aDocument);
if (!aDocument.IsNull())
anApplication->Close (aDocument);
}
}
Handle(TDocStd_Document) aDocument;
anApplication->GetDocument (aDocId, aDocument);
if (!aDocument.IsNull())
anApplication->Close (aDocument);
}
}
//! open new document
bool isSTEPFileName = false;
anApplication = DFBrowser_OpenApplication::OpenApplication (theFileName, isSTEPFileName);