mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0031769: Application Framework - regression : can not initialize two kinds of application in one thread
This commit is contained in:
parent
296f017a16
commit
ee3280a94f
@ -42,7 +42,17 @@ Handle(TObj_Application) TObj_Application::GetInstance()
|
|||||||
Handle(CDF_Session) aSession = CDF_Session::Create();
|
Handle(CDF_Session) aSession = CDF_Session::Create();
|
||||||
Handle(CDF_Application) anApp;
|
Handle(CDF_Application) anApp;
|
||||||
if (aSession->FindApplication(OSD_Thread::Current(), anApp))
|
if (aSession->FindApplication(OSD_Thread::Current(), anApp))
|
||||||
return Handle(TObj_Application)::DownCast(anApp);
|
{
|
||||||
|
Handle(TObj_Application) aTObjApp = Handle(TObj_Application)::DownCast(anApp);
|
||||||
|
if (!aTObjApp.IsNull())
|
||||||
|
return aTObjApp;
|
||||||
|
// If in session application of another type is already registered, use this global
|
||||||
|
// application, alone, outside of the session (as a workaround for DRAW scripting where
|
||||||
|
// many kinds of applications can be required).
|
||||||
|
static Handle(TObj_Application) THE_TOBJ_APP(new TObj_Application);
|
||||||
|
return THE_TOBJ_APP;
|
||||||
|
}
|
||||||
|
// It will register this application in the session.
|
||||||
return new TObj_Application;
|
return new TObj_Application;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
tests/bugs/caf/bug31769
Normal file
6
tests/bugs/caf/bug31769
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
puts "==========="
|
||||||
|
puts "0031769: Application Framework - regression : can not initialize two kinds of application in one thread"
|
||||||
|
puts "==========="
|
||||||
|
|
||||||
|
# loading of ALL initializes TDOCStd_Application, loading TOBJ initializes TObj_Application
|
||||||
|
pload ALL TOBJ
|
Loading…
x
Reference in New Issue
Block a user