fix: mutex in wholescreencapturer

This commit is contained in:
2025-11-25 17:55:50 +03:00
parent 39fcd1f18c
commit dcf9f69515
2 changed files with 7 additions and 27 deletions

View File

@@ -64,13 +64,13 @@ type wholeScreenCapturer struct {
func (w *wholeScreenCapturer) Get() (filepath string, err error) {
w.mu.RLock()
defer w.mu.Unlock()
if !w.initialized {
return "", ErrNotInitialized
}
if w.latest == "" {
return "", errors.New("no screenshot captured yet")
}
return w.latest, nil
if !w.initialized {
return "", ErrNotInitialized
}
if w.latest == "" {
return "", errors.New("no screenshot captured yet")
}
return w.latest, nil
}
// Init implements ScreenCapturer.

View File

@@ -1,20 +0,0 @@
// Copyright (c) 2025 Nikolai Papin
//
// This file is part of the Auto Attendance app that looks for
// self-attend QR-codes during lectures and opens their URLs in your
// browser.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
// the GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package platform