Commit 4fcc5fec authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

ole32: Always use object_is_running to check whether the object is running.

parent a56a0eb0
...@@ -1021,7 +1021,7 @@ static HRESULT WINAPI DefaultHandler_GetData( ...@@ -1021,7 +1021,7 @@ static HRESULT WINAPI DefaultHandler_GetData(
IDataObject_Release(cacheDataObject); IDataObject_Release(cacheDataObject);
if (FAILED(hres) && This->pDataDelegate) if (FAILED(hres) && object_is_running( This ))
hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium); hres = IDataObject_GetData(This->pDataDelegate, pformatetcIn, pmedium);
return hres; return hres;
...@@ -1067,7 +1067,7 @@ static HRESULT WINAPI DefaultHandler_QueryGetData( ...@@ -1067,7 +1067,7 @@ static HRESULT WINAPI DefaultHandler_QueryGetData(
IDataObject_Release(cacheDataObject); IDataObject_Release(cacheDataObject);
if (FAILED(hres) && This->pDataDelegate) if (FAILED(hres) && object_is_running( This ))
hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc); hres = IDataObject_QueryGetData(This->pDataDelegate, pformatetc);
return hres; return hres;
...@@ -1089,7 +1089,7 @@ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc( ...@@ -1089,7 +1089,7 @@ static HRESULT WINAPI DefaultHandler_GetCanonicalFormatEtc(
TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut); TRACE("(%p, %p, %p)\n", iface, pformatetcIn, pformatetcOut);
if (!This->pDataDelegate) if (!object_is_running( This ))
return OLE_E_NOTRUNNING; return OLE_E_NOTRUNNING;
return IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut); return IDataObject_GetCanonicalFormatEtc(This->pDataDelegate, pformatetcIn, pformatetcOut);
...@@ -1177,7 +1177,7 @@ static HRESULT WINAPI DefaultHandler_DAdvise( ...@@ -1177,7 +1177,7 @@ static HRESULT WINAPI DefaultHandler_DAdvise(
if (!This->dataAdviseHolder) if (!This->dataAdviseHolder)
{ {
hres = CreateDataAdviseHolder(&This->dataAdviseHolder); hres = CreateDataAdviseHolder(&This->dataAdviseHolder);
if (SUCCEEDED(hres) && This->pDataDelegate) if (SUCCEEDED(hres) && object_is_running( This ))
DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
} }
...@@ -1327,8 +1327,6 @@ static HRESULT WINAPI DefaultHandler_Run( ...@@ -1327,8 +1327,6 @@ static HRESULT WINAPI DefaultHandler_Run(
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
This->object_state = object_state_running;
hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn); hr = IOleObject_Advise(This->pOleDelegate, &This->IAdviseSink_iface, &This->dwAdvConn);
if (FAILED(hr)) goto fail; if (FAILED(hr)) goto fail;
...@@ -1365,6 +1363,8 @@ static HRESULT WINAPI DefaultHandler_Run( ...@@ -1365,6 +1363,8 @@ static HRESULT WINAPI DefaultHandler_Run(
(void **)&This->pDataDelegate); (void **)&This->pDataDelegate);
if (FAILED(hr)) goto fail; if (FAILED(hr)) goto fail;
This->object_state = object_state_running;
if (This->dataAdviseHolder) if (This->dataAdviseHolder)
{ {
hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate); hr = DataAdviseHolder_OnConnect(This->dataAdviseHolder, This->pDataDelegate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment