mac: fix crash in watcher. closes #1190
This commit is contained in:
parent
1e2e253f5b
commit
613b99b8dd
|
@ -151,6 +151,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
var handler = Changed;
|
var handler = Changed;
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
|
if (paths [0].Length >= Path.Length) {
|
||||||
string path = paths [0];
|
string path = paths [0];
|
||||||
path = path.Substring (Path.Length);
|
path = path.Substring (Path.Length);
|
||||||
path = path.Trim ("/".ToCharArray ());
|
path = path.Trim ("/".ToCharArray ());
|
||||||
|
@ -158,6 +159,7 @@ namespace SparkleShare {
|
||||||
if (!string.IsNullOrWhiteSpace (path))
|
if (!string.IsNullOrWhiteSpace (path))
|
||||||
handler (path);
|
handler (path);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GC.KeepAlive (this);
|
GC.KeepAlive (this);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue