| Previous | Next |
| D2DERR_TEXT_EFFECT_IS_WRONG_TYPE | D2DERR_EXCEEDS_MAX_BITMAP_SIZE |
D2DERR_TEXT_RENDERER_NOT_RELEASED
The scope of D2DERR_TEXT_RENDERER_NOT_RELEASED is Direct2D and DirectWrite text callback contracts. The application retained an IDWriteTextRenderer reference after DrawText or DrawTextLayout returned, invalidating the callback object lifetime contract. Keep 0x8899001C beside the returning method because a wrapper can replace this distinction with a generic subsystem message.
Limits of this code
This is a lifetime error, not a font-cache or text-layout content error. For D2DERR_TEXT_RENDERER_NOT_RELEASED, do not respond with a universal render-target recreation loop unless the returned status specifically documents device-loss recovery; graph, property, numeric, lifetime, and print-state errors require correcting their contract.
Start with the returning API
When D2DERR_TEXT_RENDERER_NOT_RELEASED is returned, text rendering crosses IDWriteTextLayout, drawing effects, renderer callbacks, COM reference counting, font resources, and optional glyph-image formats. A drawing-effect type mismatch, retained callback renderer, and invalid glyph image are separate failures even though all may occur during one DrawTextLayout call in the D2DERR_TEXT_RENDERER_NOT_RELEASED path.
For D2DERR_TEXT_RENDERER_NOT_RELEASED, inspect the following boundary: reference counting and callback lifetime of the renderer supplied for one draw operation.
Diagnostic evidence matrix
| Record | Why it matters here |
|---|---|
| AddRef/Release trace for the renderer | For D2DERR_TEXT_RENDERER_NOT_RELEASED, recording AddRef/Release trace for the renderer separates the Direct2D and DirectWrite text callback contracts boundary from a later wrapper symptom. |
| Callback stack and asynchronous work launched from it | In D2DERR_TEXT_RENDERER_NOT_RELEASED diagnostics, recording callback stack and asynchronous work launched from it ties the HRESULT to the Direct2D and DirectWrite text callback contracts boundary rather than to the final visible failure. |
| Text layout and draw call generation | Comparing text layout and draw call generation shows whether D2DERR_TEXT_RENDERER_NOT_RELEASED follows input, object state, or environment. |
| Objects retaining the renderer after return | Preserving objects retaining the renderer after return provides the evidence needed to test this distinction: this is a lifetime error, not a font-cache or text-layout content error. |
Useful comparison axes
| Test | Interpretation | Hold constant |
|---|---|---|
| Same environment, reduced input | If D2DERR_TEXT_RENDERER_NOT_RELEASED disappears with a smaller faithful case, complexity within Direct2D and DirectWrite text callback contracts is implicated. | For D2DERR_TEXT_RENDERER_NOT_RELEASED, keep AddRef/Release trace for the renderer fixed while simplifying text layout and draw call generation. |
| Same input, fresh object generation | If D2DERR_TEXT_RENDERER_NOT_RELEASED changes after rebuilding state, examine ownership across the caller’s object graph, custom effect or renderer, Direct2D validation layer, backing device, and deferred draw boundary. | For D2DERR_TEXT_RENDERER_NOT_RELEASED, place callback stack and asynchronous work launched from it on the timeline of the last successful transition. |
| Same operation on a controlled second path | If D2DERR_TEXT_RENDERER_NOT_RELEASED follows one environment, the failure is not explained by source data alone. | For D2DERR_TEXT_RENDERER_NOT_RELEASED, compare adapter and feature level, factory and device generations, target identity, debug-layer output, and thread ownership while preserving objects retaining the renderer after return. |
Reproduce without destructive cleanup
For D2DERR_TEXT_RENDERER_NOT_RELEASED, render plain outline text with no drawing effect, then add the effect object, custom renderer, and requested glyph image format one at a time. When D2DERR_TEXT_RENDERER_NOT_RELEASED is returned, track AddRef and Release around callbacks and retain the exact font face and glyph index.
- When D2DERR_TEXT_RENDERER_NOT_RELEASED is returned, use a stack-scoped or clearly owned renderer.
- Remove asynchronous retention from callbacks in the D2DERR_TEXT_RENDERER_NOT_RELEASED path.
- For D2DERR_TEXT_RENDERER_NOT_RELEASED, assert final reference count at draw return.
- When D2DERR_TEXT_RENDERER_NOT_RELEASED is returned, copy only immutable data needed after the callback.
What success must demonstrate
A correction for D2DERR_TEXT_RENDERER_NOT_RELEASED should let the operation at the Direct2D and DirectWrite text callback contracts boundary complete repeatedly under the original supported conditions. Repeat the control that begins with “Use a stack-scoped or clearly owned renderer” and confirm that the following lifecycle step also succeeds. For D2DERR_TEXT_RENDERER_NOT_RELEASED, keep the original failing sample and one deliberate negative case so fallback cannot be mistaken for repair.
Technical references
When D2DERR_TEXT_RENDERER_NOT_RELEASED is returned, these references define the public API family, object model, or error list used to interpret this status.
- Microsoft: Direct2D error codes.
- Microsoft: Direct2D API overview.
- Microsoft: Introducing DirectWrite.
- Microsoft: Glyph image formats in DirectWrite.
Looking for a different code? Search another status or error code.