MCPcopy Create free account
hub / github.com/creatale/node-dv / sarrayDestroy

Function sarrayDestroy

deps/leptonica/src/sarray1.c:354–383  ·  view source on GitHub ↗

! * \brief sarrayDestroy() * * \param[in,out] psa to be nulled * \return void * * * Notes: * (1) Decrements the ref count and, if 0, destroys the sarray. * (2) Always nulls the input ptr. * */

Source from the content-addressed store, hash-verified

352 * </pre>
353 */
354void
355sarrayDestroy(SARRAY **psa)
356{
357l_int32 i;
358SARRAY *sa;
359
360 PROCNAME("sarrayDestroy");
361
362 if (psa == NULL) {
363 L_WARNING("ptr address is NULL!\n", procName);
364 return;
365 }
366 if ((sa = *psa) == NULL)
367 return;
368
369 sarrayChangeRefcount(sa, -1);
370 if (sarrayGetRefcount(sa) <= 0) {
371 if (sa->array) {
372 for (i = 0; i < sa->n; i++) {
373 if (sa->array[i])
374 LEPT_FREE(sa->array[i]);
375 }
376 LEPT_FREE(sa->array);
377 }
378 LEPT_FREE(sa);
379 }
380
381 *psa = NULL;
382 return;
383}
384
385
386/*!

Callers 15

generateFixedStringsPdfFunction · 0.85
generatePageStringPdfFunction · 0.85
generateContentStringPdfFunction · 0.85
makeTrailerStringPdfFunction · 0.85
parseTrailerPdfFunction · 0.85
pdfdataDestroyFunction · 0.85
pixaReadFilesFunction · 0.85
parseForProtosFunction · 0.85
captureProtoSignatureFunction · 0.85
cleanProtoSignatureFunction · 0.85
convertFilesTo1bppFunction · 0.85

Calls 2

sarrayChangeRefcountFunction · 0.85
sarrayGetRefcountFunction · 0.85

Tested by

no test coverage detected