Skip to content

Commit

Permalink
smal bug fixes
Browse files Browse the repository at this point in the history
- disable the 'load into memory' feature for preview window since it
initially needs much CPU time witch is bad for responsiveness of the
system preferences app
- the drawAttributedString() did not free the OpenGL texture with the
output text
  • Loading branch information
Waitsnake committed Nov 3, 2018
1 parent 32b9d68 commit 22df24b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions AnimatedGif/AnimatedGifView.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ - (void)startAnimation
backgrBlue = [defaults floatForKey:@"BackgrBlue"];
NSInteger changeIntervalInMin = [defaults integerForKey:@"ChangeInterval"];

// In case if preview window never use the 'load into memory' feature since it initially needs much CPU time witch is bad inside the system preferences app
if ([self isPreview])
{
loadAnimationToMem = FALSE;
}

// select a random file from directory or keep the file if it was already a file
NSString *newGifFileName = [self getRandomGifFile:gifFileName];

Expand Down Expand Up @@ -1351,6 +1357,7 @@ - (void) drawAttributedString:(NSAttributedString *)attributedString atPoint:(NS
glTexCoord2f (texturSize.width, 0.0f); glVertex2f (bounds.origin.x + bounds.size.width, bounds.origin.y);
glEnd ();
glPopAttrib();
glDeleteTextures(1,&texturName);
}

- (void) drawImage:(void *)pixelsBytes atRect:(NSRect) rect
Expand Down
Binary file modified Release/AnimatedGif.saver.zip
Binary file not shown.

0 comments on commit 22df24b

Please sign in to comment.