I use this code in order to capture the color of a pixel, compare it with a HTML value and do an action if the comparisono is successful
Every time it goes through the loop the program takes almost 4MB of memory usageQt Code:
while(1){ sleep(3000); *img = a->toImage(); QRgb b = img->pixel(796,554); c->setRgb(b); qDebug() << c->name(); delete a; delete c; if(c->name() == "#968d82"){ system("canberra-gtk-play -f ~/Documents/Alert.wav"); }To copy to clipboard, switch view to plain text mode
It's probaly because it grubs the whole desktop picture every time it runs...
I tried to free some by deleting 'a' and 'c' but it didn't work. Any suggestion?
Bookmarks