Skip to content

Commit

Permalink
Add removing the update_stats event on destroing
Browse files Browse the repository at this point in the history
Add Uint8Array checking
  • Loading branch information
konkor committed Oct 13, 2019
1 parent bf8221c commit 90da534
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/center.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const _ = Gettext.gettext;
const APPDIR = get_appdir ();
imports.searchPath.unshift(APPDIR);
const Convenience = imports.convenience;
const b2s = Convenience.byteArrayToString;
const Prefs = imports.prefs;

const DEBUG_KEY = 'debug';
Expand Down Expand Up @@ -129,7 +130,7 @@ var ObminCenter = new Lang.Class ({
let run = false;
let res = GLib.spawn_command_line_sync ("ps -A");
let o, n;
if (res[0]) o = res[1].toString().split("\n");
if (res[0]) o = b2s (res[1]).toString().split("\n");
res = null;
for (let i = 0; i < o.length; i++) {
if (o[i].indexOf ("obmin-server") > -1) {
Expand Down Expand Up @@ -198,6 +199,10 @@ var ObminCenter = new Lang.Class ({

this.sidebar.connect ('stack_update', Lang.bind (this, this.on_stack));
this.run_button.connect ('toggled', Lang.bind (this, this.on_run));
window.connect ('destroy', () => {
if (update_event) GLib.Source.remove (update_event);
update_event = 0;
});
/*this.sidebar.exit_button.button.connect ('clicked', Lang.bind (this, ()=>{
this.application.quit ();
}));*/
Expand Down

0 comments on commit 90da534

Please sign in to comment.