bool DestroyJobsManager () { ClearLinkedList (& (s_manager_p -> slm_running_services)); FreeMemory (s_manager_p); return true; }
MagickPrivate MagickBooleanType ClearExceptionInfo(ExceptionInfo *exception, MagickBooleanType relinquish) { assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); if (exception->semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&exception->semaphore); LockSemaphoreInfo(exception->semaphore); if (relinquish == MagickFalse) relinquish=exception->relinquish; exception->severity=UndefinedException; if (relinquish != MagickFalse) { exception->signature=(~MagickSignature); if (exception->exceptions != (void *) NULL) exception->exceptions=(void *) DestroyLinkedList((LinkedListInfo *) exception->exceptions,DestroyExceptionElement); } else if (exception->exceptions != (void *) NULL) ClearLinkedList((LinkedListInfo *) exception->exceptions, DestroyExceptionElement); UnlockSemaphoreInfo(exception->semaphore); if (relinquish != MagickFalse) DestroySemaphoreInfo(&exception->semaphore); return(relinquish); }
/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % % D e s t r o y E x c e p t i o n I n f o % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DestroyExceptionInfo() deallocates memory associated with an exception. % % The format of the DestroyExceptionInfo method is: % % ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception) % % A description of each parameter follows: % % o exception: the exception info. % */ MagickExport ExceptionInfo *DestroyExceptionInfo(ExceptionInfo *exception) { MagickBooleanType relinquish; assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickCoreSignature); if (exception->semaphore == (SemaphoreInfo *) NULL) ActivateSemaphoreInfo(&exception->semaphore); LockSemaphoreInfo(exception->semaphore); exception->severity=UndefinedException; if (exception->relinquish != MagickFalse) { exception->signature=(~MagickCoreSignature); if (exception->exceptions != (void *) NULL) exception->exceptions=(void *) DestroyLinkedList((LinkedListInfo *) exception->exceptions,DestroyExceptionElement); } else if (exception->exceptions != (void *) NULL) ClearLinkedList((LinkedListInfo *) exception->exceptions, DestroyExceptionElement); relinquish=exception->relinquish; UnlockSemaphoreInfo(exception->semaphore); if (relinquish != MagickFalse) { RelinquishSemaphoreInfo(&exception->semaphore); exception=(ExceptionInfo *) RelinquishMagickMemory(exception); } return(exception); }
MagickExport void ClearMagickException(ExceptionInfo *exception) { assert(exception != (ExceptionInfo *) NULL); assert(exception->signature == MagickSignature); if (exception->exceptions == (void *) NULL) return; LockSemaphoreInfo(exception->semaphore); ClearLinkedList((LinkedListInfo *) exception->exceptions, DestroyExceptionElement); exception->severity=UndefinedException; exception->reason=(char *) NULL; exception->description=(char *) NULL; UnlockSemaphoreInfo(exception->semaphore); errno=0; }
/* FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) PURPOSE: Windows procedure for the main window PARAMETERS: hWnd - window handle message - window message wParam - window message parameter (depends on message) lParam - window message parameter (depends on message) RETURN: If the message was processed, the return value is 0 If the message was not processed and passed to DefWindowProc and the return value depends on the value of that function. */ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { SCROLLINFO si; switch (message) { case WM_CREATE: // case for when the window is created InitLinkedList(); clpFormat = RegisterClipboardFormat(TEXT("DRAWING_OBJECT")); OpenChildWindows(hWnd); break; case WM_DESTROY: // case for when the window is closed PostQuitMessage(0); break; case WM_SETFOCUS: // case for when the window gains focus break; case WM_KILLFOCUS: // case for when the window focus is lost break; case WM_COMMAND: // case for menu commands MenuDispatch(LOWORD(wParam), hWnd, lParam); break; case WM_SIZE: // case for when the window is resized // Set vertical scrollbar range and page size si.cbSize = sizeof(si); si.fMask = SIF_RANGE | SIF_PAGE; si.nMin = 0; si.nMax = 1200; si.nPage = Y_SIZE; SetScrollInfo(hWnd, SB_VERT, &si, TRUE); // Set horizontal scrollbar range and page size si.cbSize = sizeof(si); si.fMask = SIF_RANGE | SIF_PAGE; si.nMin = 0; si.nMax = 1600; si.nPage = X_SIZE; SetScrollInfo(hWnd, SB_HORZ, &si, TRUE); break; case WM_VSCROLL: // when the vertical scrollbar is moved ScrollVert(ghWndCanvas, LOWORD(wParam), HIWORD(wParam)); break; case WM_HSCROLL: // when the horizontal scrollbar is moved ScrollHorz(ghWndCanvas, LOWORD(wParam), HIWORD(wParam)); break; case WM_PAINT: PaintWindow(hWnd); break; case WM_CLOSE: ClearLinkedList(); DestroyWindow(hWnd); break; default: return (int)DefWindowProc(hWnd, message, wParam, lParam); } return 0; }