Notifier no gastava Resource per als sons

Resource no alliberava correctament els elements de JailAudio
This commit is contained in:
2024-11-27 18:20:33 +01:00
parent 6ed37425bf
commit eed45bdbc6
4 changed files with 49 additions and 19 deletions

View File

@@ -62,7 +62,6 @@ private:
std::vector<Notification> notifications_; // La lista de notificaciones activas
bool stack_; // Indica si las notificaciones se apilan
bool has_icons_; // Indica si el notificador tiene textura para iconos
JA_Sound_t *sound_; // Sonido a reproducir cuando suena la notificación
// Elimina las notificaciones finalizadas
void clearFinishedNotifications();
@@ -73,14 +72,14 @@ private:
// [SINGLETON] Ahora el constructor y el destructor son privados, para no poder crear objetos notifier desde fuera
// Constructor
Notifier(std::string icon_file, std::shared_ptr<Text> text, const std::string &sound_file);
Notifier(std::string icon_file, std::shared_ptr<Text> text);
// Destructor
~Notifier();
~Notifier() = default;
public:
// [SINGLETON] Crearemos el objeto notifier con esta función estática
static void init(const std::string &icon_file, std::shared_ptr<Text> text, const std::string &sound_file);
static void init(const std::string &icon_file, std::shared_ptr<Text> text);
// [SINGLETON] Destruiremos el objeto notifier con esta función estática
static void destroy();