private void CleanUp()
        {
            if (OriginalBitmap != null)
            {
                OriginalBitmap.Dispose();
                OriginalBitmap = null;
            }

            if (SizedBitmap != null)
            {
                SizedBitmap.Dispose();
                SizedBitmap = null;
            }
        }
Exemple #2
0
        public void Dispose()
        {
            ProcessedImage?.Dispose();
            OriginalBitmap?.Dispose();
            ContoursImage?.Dispose();

            foreach (var potentialLicensePlate in PotentialFirstLayerLicensePlates)
            {
                potentialLicensePlate.Image.Dispose();
            }

            foreach (var potentialLicensePlate in PotentialSecondLayerLicensePlates)
            {
                potentialLicensePlate.Image.Dispose();
            }

            foreach (var actualLicensePlates in ActualLicensePlates)
            {
                actualLicensePlates.Image.Dispose();
            }

            ImageWithLicenses?.Dispose();
        }