changeset 27:a236cd1f0477

fixes
author cin
date Mon, 03 Mar 2014 08:59:03 +0400
parents f0bf98e4d22c
children 81708975d6f7
files Implab.v11.suo Implab/Promise.cs
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
Binary file Implab.v11.suo has changed
--- a/Implab/Promise.cs	Fri Feb 21 03:15:28 2014 +0400
+++ b/Implab/Promise.cs	Mon Mar 03 08:59:03 2014 +0400
@@ -316,7 +316,7 @@
             var medium = new Promise<T>(this, true);
 
             AddHandler(
-                null,
+                x => medium.Resolve(x),
                 e => {
                     try {
                         medium.Resolve(handler(e));
@@ -541,12 +541,12 @@
                 // if the promise have been resolved while we was adding handler to the queue
                 // we can't guarantee that someone is still processing it
                 // therefore we will fetch a handler from the queue and execute it
-                // note that fetched handler may be not the one we have added
+                // note that fetched handler may be not the one that we have added
+                // even we can fetch no handlers at all :)
                 InvokeHandler(handler);
-
         }
 
-        void InvokeHandler(HandlerDescriptor handler) {
+        protected virtual void InvokeHandler(HandlerDescriptor handler) {
             switch (m_state) {
                 case SucceededState:
                     handler.Resolve(m_result);