scoRetrieveScopeMemory(block->work, &pScopeMemory);
if(scoGetScopeActivation(pScopeMemory) == 1)
{
- sciSetUsedWindow(scoGetWindowID(pScopeMemory));
+ /*sciSetUsedWindow(scoGetWindowID(pScopeMemory));*/
- if (scoGetPointerScopeWindow(pScopeMemory) != NULL)
- {
- for(i = 0 ; i < scoGetNumberOfCurvesBySubwin(pScopeMemory,0); i++)
- {
- Pinceau = scoGetPointerLongDraw(pScopeMemory,0,i);
- forceRedraw(Pinceau);
- }
- }
- //Here Pinceau = Window
- Pinceau = sciGetCurrentFigure();
- pFIGURE_FEATURE(Pinceau)->user_data = NULL;
- pFIGURE_FEATURE(Pinceau)->size_of_user_data = 0;
- /* restore double buffering */
- sciSetJavaUseSingleBuffer(Pinceau, FALSE);
- }
+ /* Check if figure is still opened, otherwise, don't try to destroy it again. */
+ scoGraphicalObject figure = scoGetPointerScopeWindow(pScopeMemory);
+ if (figure != NULL)
+ {
+ for(i = 0 ; i < scoGetNumberOfCurvesBySubwin(pScopeMemory,0); i++)
+ {
+ Pinceau = scoGetPointerLongDraw(pScopeMemory,0,i);
+ forceRedraw(Pinceau);
+ }
+
+ //Here Pinceau = Window
+ /*Pinceau = sciGetCurrentFigure();*/
+ /*pFIGURE_FEATURE(Pinceau)->user_data = NULL;
+ pFIGURE_FEATURE(Pinceau)->size_of_user_data = 0;*/
+ clearUserData(figure);
+ /* restore double buffering */
+ sciSetJavaUseSingleBuffer(figure, FALSE);
+ }
+ }
scoFreeScopeMemory(block->work, &pScopeMemory);
break; //Break of the switch
}